Commit 40650ea6 by Dwight Engen Committed by Serge Hallyn

quiet gcc 4.4.7 warning about saveptr use before initialization

parent de09eccb
...@@ -551,7 +551,7 @@ out: ...@@ -551,7 +551,7 @@ out:
static int in_cgroup_list(char *s, char *list) static int in_cgroup_list(char *s, char *list)
{ {
char *token, *str, *saveptr; char *token, *str, *saveptr = NULL;
if (!list || !s) if (!list || !s)
return 0; return 0;
...@@ -566,7 +566,7 @@ static int in_cgroup_list(char *s, char *list) ...@@ -566,7 +566,7 @@ static int in_cgroup_list(char *s, char *list)
static int have_visited(char *opts, char *visited, char *allcgroups) 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) { for (str = strdupa(opts); (token = strtok_r(str, ",", &s)); str = NULL) {
if (!in_cgroup_list(token, allcgroups)) if (!in_cgroup_list(token, allcgroups))
...@@ -580,7 +580,7 @@ static int have_visited(char *opts, char *visited, char *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) static int record_visited(char *opts, char **visitedp, char *allcgroups)
{ {
char *s, *token, *str; char *s = NULL, *token, *str;
int oldlen, newlen, ret; int oldlen, newlen, ret;
for (str = strdupa(opts); (token = strtok_r(str, ",", &s)); str = NULL) { for (str = strdupa(opts); (token = strtok_r(str, ",", &s)); str = NULL) {
......
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