vty: Use NULL to have a null pointer instead of '\0'
'\0' gets translated to zero but the argument to vector_set is
a pointer and it gets converted to a pointer.
vty.c:985:21: warning: expression which evaluates to zero treated as a null pointer constant of type
'void *' [-Wnon-literal-null-conversion]
vector_set(vline, '\0');
^~~~
vty.c:1095:21: warning: expression which evaluates to zero treated as a null pointer constant of type
'void *' [-Wnon-literal-null-conversion]
vector_set(vline, '\0');
^~~~
vty.c:1097:21: warning: expression which evaluates to zero treated as a null pointer constant of type
'void *' [-Wnon-literal-null-conversion]
vector_set(vline, '\0');
^~~~
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 230d74c..5bcbe4a 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -982,7 +982,7 @@
/* In case of 'help \t'. */
if (isspace((int)vty->buf[vty->length - 1]))
- vector_set(vline, '\0');
+ vector_set(vline, NULL);
matched = cmd_complete_command(vline, vty, &ret);
@@ -1092,9 +1092,9 @@
/* In case of '> ?'. */
if (vline == NULL) {
vline = vector_init(1);
- vector_set(vline, '\0');
+ vector_set(vline, NULL);
} else if (isspace((int)vty->buf[vty->length - 1]))
- vector_set(vline, '\0');
+ vector_set(vline, NULL);
describe = cmd_describe_command(vline, vty, &ret);