From 1d03ec88f13adb22dfb12efc73c410fca032547b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 11 Jun 2003 06:23:53 +0000 Subject: several places in client.c rely in commands[i].name == NULL being a termination condition for checking for commands. Make sure the last element is indeed NULL. (This used to be commit 294f79884df1ebc4a8d955601e7547bdcadef5d6) --- source3/client/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/client') diff --git a/source3/client/client.c b/source3/client/client.c index bfa587d11a..f2be268efe 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -2108,7 +2108,7 @@ static struct /* Yes, this must be here, see crh's comment above. */ {"!",NULL,"run a shell command on the local system",{COMPL_NONE,COMPL_NONE}}, - {"",NULL,NULL,{COMPL_NONE,COMPL_NONE}} + {NULL,NULL,NULL,{COMPL_NONE,COMPL_NONE}} }; @@ -2328,7 +2328,7 @@ static char **completion_fn(const char *text, int start, int end) if (sp == NULL) return NULL; - for (i = 0; commands[i].description; i++) + for (i = 0; commands[i].name; i++) if ((strncmp(commands[i].name, text, sp - buf) == 0) && (commands[i].name[sp - buf] == 0)) break; if (commands[i].name == NULL) -- cgit