From d56c3cbb2cbdd9b0114e325556cb5efc434b2894 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 9 Nov 2015 16:16:00 +0000 Subject: 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'); ^~~~ --- src/vty/vty.c | 6 +++--- 1 file 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); -- cgit v1.2.3