diff options
author | Eric Sandeen <sandeen@redhat.com> | 2013-02-26 15:50:22 -0600 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2013-02-27 14:40:09 +0100 |
commit | e7cce77a56bff57144954b8b21fa1e79f00f549e (patch) | |
tree | 9801283ba1ae251bc002704597260bcfcb2005f5 /cmds-balance.c | |
parent | fb631862c98bbed777026597ef73b3194da69892 (diff) |
btrfs-progs: initialize save_ptr prior to strtok_r
The coverity runs had a false positive complaining that
save_ptr is uninitialized in the call to strtok_r.
Turns out that under the covers glibc was doing enough
to confuse the checker about what was being called.
Just to keep the noise down, do a harmless initialization,
with a comment as to why.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Diffstat (limited to 'cmds-balance.c')
-rw-r--r-- | cmds-balance.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds-balance.c b/cmds-balance.c index b671e1d7..f5dc317f 100644 --- a/cmds-balance.c +++ b/cmds-balance.c @@ -67,7 +67,7 @@ static int parse_one_profile(const char *profile, u64 *flags) static int parse_profiles(char *profiles, u64 *flags) { char *this_char; - char *save_ptr; + char *save_ptr = NULL; /* Satisfy static checkers */ for (this_char = strtok_r(profiles, "|", &save_ptr); this_char != NULL; @@ -136,7 +136,7 @@ static int parse_filters(char *filters, struct btrfs_balance_args *args) { char *this_char; char *value; - char *save_ptr; + char *save_ptr = NULL; /* Satisfy static checkers */ if (!filters) return 0; |