From 9f7d541a405f22bf8bd0c1e2c2ba520c5c36da10 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 15 May 2016 21:07:50 -0400 Subject: [PATCH] vtysh: fix vtysh warnings from another compiler Remove some dead code and fix char `\0` being used as NULL. Signed-off-by: Donald Sharp Reviewed-by: Daniel Walton --- vtysh/vtysh.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 44d67e8f9d..9c628a0ee9 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -768,11 +768,11 @@ vtysh_rl_describe (void) if (vline == NULL) { vline = vector_init (1); - vector_set (vline, '\0'); + vector_set (vline, NULL); } else if (rl_end && isspace ((int) rl_line_buffer[rl_end - 1])) - vector_set (vline, '\0'); + vector_set (vline, NULL); describe = cmd_describe_command (vline, vty, &ret); @@ -862,7 +862,7 @@ command_generator (const char *text, int state) return NULL; if (rl_end && isspace ((int) rl_line_buffer[rl_end - 1])) - vector_set (vline, '\0'); + vector_set (vline, NULL); matched = cmd_complete_command (vline, vty, &complete_status); } @@ -891,34 +891,6 @@ new_completion (char *text, int start, int end) return matches; } -#if 0 -/* This function is not actually being used. */ -static char ** -vtysh_completion (char *text, int start, int end) -{ - int ret; - vector vline; - char **matched = NULL; - - if (vty->node == AUTH_NODE || vty->node == AUTH_ENABLE_NODE) - return NULL; - - vline = cmd_make_strvec (rl_line_buffer); - if (vline == NULL) - return NULL; - - /* In case of 'help \t'. */ - if (rl_end && isspace ((int) rl_line_buffer[rl_end - 1])) - vector_set (vline, '\0'); - - matched = cmd_complete_command (vline, vty, &ret); - - cmd_free_strvec (vline); - - return (char **) matched; -} -#endif - /* Vty node structures. */ static struct cmd_node bgp_node = { -- 2.39.5