summaryrefslogtreecommitdiffstats
path: root/sbin/mdmfs/mdmfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/mdmfs/mdmfs.c')
-rw-r--r--sbin/mdmfs/mdmfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c
index acc6e00..59e194e 100644
--- a/sbin/mdmfs/mdmfs.c
+++ b/sbin/mdmfs/mdmfs.c
@@ -583,12 +583,13 @@ run(int *ofd, const char *cmdline, ...)
argv = (char **)malloc(sizeof(*argv) * (argc + 1));
assert(argv != NULL);
for (p = cmd, argvp = argv; (*argvp = strsep(&p, " ")) != NULL;)
- if (**argv != '\0')
+ if (**argvp != '\0')
if (++argvp >= &argv[argc]) {
*argvp = NULL;
break;
}
assert(*argv);
+ /* The argv array ends up NULL-terminated here. */
/* Make sure the above loop works as expected. */
if (debug) {
OpenPOWER on IntegriCloud