]> 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>
Fri, 17 May 2013 21:40:12 +0000 (17:40 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 20 May 2013 14:27:28 +0000 (09:27 -0500)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/cgroup.c

index a8ae8c1a53bc2c9802fccda7478312643157de1d..c2f0a2da45437c1ccaa496cf3cce6eba30cdf903 100644 (file)
@@ -551,7 +551,7 @@ out:
 
 static int in_cgroup_list(char *s, char *list)
 {
-       char *token, *str, *saveptr;
+       char *token, *str, *saveptr = NULL;
 
        if (!list || !s)
                return 0;
@@ -566,7 +566,7 @@ static int in_cgroup_list(char *s, char *list)
 
 static int have_visited(char *opts, char *visited, char *allcgroups)
 {
-       char *str, *s, *token;
+       char *str, *s = NULL, *token;
 
        for (str = strdupa(opts); (token = strtok_r(str, ",", &s)); str = NULL) {
                if (!in_cgroup_list(token, allcgroups))
@@ -580,7 +580,7 @@ static int have_visited(char *opts, char *visited, char *allcgroups)
 
 static int record_visited(char *opts, char **visitedp, char *allcgroups)
 {
-       char *s, *token, *str;
+       char *s = NULL, *token, *str;
        int oldlen, newlen, ret;
 
        for (str = strdupa(opts); (token = strtok_r(str, ",", &s)); str = NULL) {