[lxc-devel] [PATCH] quiet gcc 4.4.7 warning about saveptr use before initialization
Serge Hallyn
serge.hallyn at ubuntu.com
Fri May 17 21:51:37 UTC 2013
Quoting Dwight Engen (dwight.engen at oracle.com):
> Signed-off-by: Dwight Engen <dwight.engen at oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
thanks.
> ---
> src/lxc/cgroup.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
> index a8ae8c1..c2f0a2d 100644
> --- a/src/lxc/cgroup.c
> +++ b/src/lxc/cgroup.c
> @@ -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) {
> --
> 1.7.1
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
More information about the lxc-devel
mailing list