From 379b1bf4d085439639e7c535aac08345809dd6aa Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Thu, 15 Jan 2015 21:40:53 +0100 Subject: [PATCH] new: Fix a pointer problem I should learn to get such stuff right without the need to draw the memory layout with boxes and lines on paper ... Thanks to the test suite for catching this one! --- uip/new.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uip/new.c b/uip/new.c index a43a710..1ee95ff 100644 --- a/uip/new.c +++ b/uip/new.c @@ -314,7 +314,7 @@ doit(char *cur, char *folders, char *sequences[]) char *sequences_s = NULL; int argc = 0; char *argv[MAXARGS]; - char *cp; + char **seqp; char buf[BUFSIZ]; if (cur == NULL || cur[0] == '\0') { @@ -391,8 +391,8 @@ doit(char *cur, char *folders, char *sequences[]) argv[argc++] = "scan"; snprintf(buf, sizeof buf, "+%s", node->n_name); argv[argc++] = buf; - for (cp=*sequences; *cp; cp++) { - argv[argc++] = cp; + for (seqp=sequences; *seqp; seqp++) { + argv[argc++] = *seqp; } argv[argc] = (char *)NULL; execprog(*argv, argv); -- 1.7.10.4