提交 8e2b7056 编写于 作者: N Neil Horman 提交者: Linus Torvalds

argv_split: allow argv_split to handle NULL pointer in argcp parameter gracefully

It would be nice if the argv_split library function could gracefully handle
a NULL pointer in the argcp parameter, so as to allow functions using it
that did not care about the value of argc to not have to declare a useless
variable.  This patch accomplishes that.  Tested by me, with successful
results.
Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
Acked-by: NJeremy Fitzhardinge <jeremy@goop.org>
Cc: Satyam Sharma <satyam@infradead.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 2a9807c0
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册