aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/argv_split.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/argv_split.c b/lib/argv_split.c
index 4096ed42f49..fad6ce4f7b5 100644
--- a/lib/argv_split.c
+++ b/lib/argv_split.c
@@ -75,7 +75,9 @@ char **argv_split(gfp_t gfp, const char *str, int *argcp)
if (argv == NULL)
goto out;
- *argcp = argc;
+ if (argcp)
+ *argcp = argc;
+
argvp = argv;
while (*str) {