aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-11-09 16:16:00 +0000
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-11-09 16:16:00 +0000
commitd56c3cbb2cbdd9b0114e325556cb5efc434b2894 (patch)
treedd87a0bf89b4a7189e9a23e54edc22807c912ed6
parent61816048ce245c92b0e9e1f1fa8e68f9c8444f8f (diff)
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'); ^~~~
-rw-r--r--src/vty/vty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 230d74c0..5bcbe4a9 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -982,7 +982,7 @@ static void vty_complete_command(struct vty *vty)
/* 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 @@ static void vty_describe_command(struct vty *vty)
/* 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);