From: markus schnalke Date: Thu, 15 Jan 2015 20:40:53 +0000 (+0100) Subject: new: Fix a pointer problem X-Git-Tag: mmh-0.2-RC1~63 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;ds=inline;h=379b1bf4d085439639e7c535aac08345809dd6aa;p=mmh 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! --- 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);