summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-04-10 15:57:34 +1000
committerJeremy Kerr <jk@ozlabs.org>2015-04-14 15:40:55 +1000
commit388e5c51b182e904c088d14c387f61162b07aee6 (patch)
tree1b538bcff9aeda051b8e5f30b7929f238ef2cf2f /discover
parenta240e296ac2ecf8934f71cb23946fc77101cdfd6 (diff)
downloadpetitboot-388e5c51b182e904c088d14c387f61162b07aee6.zip
petitboot-388e5c51b182e904c088d14c387f61162b07aee6.tar.gz
discover: Initialise strtok_r saveptr to NULL
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover')
-rw-r--r--discover/boot.c2
-rw-r--r--discover/grub2/env.c2
-rw-r--r--discover/platform-powerpc.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/discover/boot.c b/discover/boot.c
index 6e7fda6..7778b3f 100644
--- a/discover/boot.c
+++ b/discover/boot.c
@@ -177,7 +177,7 @@ static void boot_hook_update(struct boot_task *task, const char *hookname,
char *buf)
{
char *line, *name, *val, *sep;
- char *saveptr;
+ char *saveptr = NULL;
for (;; buf = NULL) {
diff --git a/discover/grub2/env.c b/discover/grub2/env.c
index 9de5e9f..1336824 100644
--- a/discover/grub2/env.c
+++ b/discover/grub2/env.c
@@ -17,7 +17,7 @@ static const char *signature = "# GRUB Environment Block\n";
static int parse_buf_to_env(struct grub2_script *script, void *buf, int len)
{
- char *tmp, *line, *sep;
+ char *tmp = NULL, *line, *sep;
int siglen;
siglen = strlen(signature);
diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index 395f134..a293ce9 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -337,7 +337,7 @@ out_err:
static int parse_one_dns_config(struct config *config,
char *confstr)
{
- char *tok, *saveptr;
+ char *tok, *saveptr = NULL;
for (tok = strtok_r(confstr, ",", &saveptr); tok;
tok = strtok_r(NULL, ",", &saveptr)) {
OpenPOWER on IntegriCloud