diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-04-11 16:11:51 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-04-16 09:08:45 +0800 |
commit | cf651e02fb7a34545211708c2a285cd228645531 (patch) | |
tree | 96830acda3e05d5293abe077219dd24f48464ee9 /discover/platform-powerpc.c | |
parent | ada4ea46dd44e667bfe6341e0b7b5366e5741351 (diff) | |
download | petitboot-cf651e02fb7a34545211708c2a285cd228645531.zip petitboot-cf651e02fb7a34545211708c2a285cd228645531.tar.gz |
discover: Fix uninitialised var warnings
We get a couple of uninitialised var warning when compiling with certain
CFLAGS (-fprofile-arcs -ftest-coverage at this stage).
In statement_if_execute: We'll never actually use this uninitialised (as
there must be at least one conditional in the parsed statement), but we
should address the warning nonetheless.
As passed to strtok_r: strtok will initialise this, but it isn't obvious
to the compiler.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/platform-powerpc.c')
-rw-r--r-- | discover/platform-powerpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c index d1d4191..28c081d 100644 --- a/discover/platform-powerpc.c +++ b/discover/platform-powerpc.c @@ -344,8 +344,8 @@ static int parse_one_dns_config(struct config *config, static void populate_network_config(struct platform_powerpc *platform, struct config *config) { + char *val, *saveptr = NULL; const char *cval; - char *val; int i; cval = get_param(platform, "petitboot,network"); @@ -355,7 +355,7 @@ static void populate_network_config(struct platform_powerpc *platform, val = talloc_strdup(config, cval); for (i = 0; ; i++) { - char *tok, *saveptr; + char *tok; tok = strtok_r(i == 0 ? val : NULL, " ", &saveptr); if (!tok) |