mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-13 22:12:15 +00:00
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: Leonid Isaev <leonid.isaev@jila.colorado.edu> Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
1ee85fbcc4
commit
5590a671bc
@ -670,7 +670,7 @@ static char **split_init_cmd(const char *incmd)
|
||||
{
|
||||
size_t len;
|
||||
int nargs = 0;
|
||||
char *copy, *p, *saveptr;
|
||||
char *copy, *p, *saveptr = NULL;
|
||||
char **argv;
|
||||
|
||||
if (!incmd)
|
||||
|
Loading…
Reference in New Issue
Block a user