libcmd: Don't increment array then discard result
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Tue, 15 Jun 2010 17:09:53 +0000 (18:09 +0100)
committerJeffrey Altman <jaltman@openafs.org>
Sat, 23 Jul 2011 04:11:08 +0000 (21:11 -0700)
We don't need to increment argv here, as we're about to return
to the caller.

Change-Id: I442fe741e4bda91e12375a6fe72657dc215c4e78
Reviewed-on: http://gerrit.openafs.org/5078
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/cmd/cmd.c

index 1ead1ca..90fa470 100644 (file)
@@ -1159,7 +1159,7 @@ CopyBackArgs(struct cmd_token *alist, char **argv,
        argv++;
        count++;
     }
-    *(argv++) = 0;             /* use last slot for terminating null */
+    *argv = NULL;              /* use last slot for terminating null */
     /* don't count terminating null */
     *an = count;
     return 0;