]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
quiet gcc 4.4.7 warning about saveptr use before initialization
authorDwight Engen <dwight.engen@oracle.com>
Tue, 16 Apr 2013 15:47:29 +0000 (11:47 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 16 Apr 2013 16:16:11 +0000 (18:16 +0200)
The recent change to use strtok_r causes a build warning with this older
gcc version, so initialize saveptr to NULL to quiet the compiler and
unbreak the build. There was no warning with gcc 4.7.2 that I
originally tested with.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/conf.c

index cf97eeffd16c535fb47c0ad0905f2efce5b8a72d..f8950500335c87359c507cff85978e1c587518b2 100644 (file)
@@ -759,7 +759,7 @@ static int setup_tty(const struct lxc_rootfs *rootfs,
 static int setup_rootfs_pivot_root_cb(char *buffer, void *data)
 {
        struct lxc_list *mountlist, *listentry, *iterator;
-       char *pivotdir, *mountpoint, *mountentry, *saveptr;
+       char *pivotdir, *mountpoint, *mountentry, *saveptr = NULL;
        int found;
        void **cbparm;