Commit 5590a671 by Leonid Isaev Committed by Serge Hallyn

Initialize a pointer in split_init_cmd() to avoid gcc warnings

gcc -Wall warns about uninitialized variables (-Wmaybe-uninitialized), and -Werror makes it fatal. This change allows the build to succeed by NULL'ifying the pointer passed to strtok_r(). Note that strtok_r(3) anyway ignores a non-NULL arg3 pointer on the 1st call with non-NULL arg1 string. Signed-off-by: 's avatarLeonid Isaev <leonid.isaev@jila.colorado.edu> Acked-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 1ee85fbc
...@@ -670,7 +670,7 @@ static char **split_init_cmd(const char *incmd) ...@@ -670,7 +670,7 @@ static char **split_init_cmd(const char *incmd)
{ {
size_t len; size_t len;
int nargs = 0; int nargs = 0;
char *copy, *p, *saveptr; char *copy, *p, *saveptr = NULL;
char **argv; char **argv;
if (!incmd) if (!incmd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment