summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2013-03-04 16:39:56 -0600
committerDavid Sterba <dsterba@suse.cz>2013-03-10 15:54:49 +0100
commit1b18ff60b181c4246b287a6b704e56b8e9ecf7fb (patch)
treec902254208a6a2c424ac254d43ead2f555f5ae1e /utils.c
parentdd53ec1c12e0794fed80bc9596d9da7823a61714 (diff)
btrfs-progs: check for null string in parse_size
Because it's better than a segfault if it's called improperly, and it makes static checkers happier. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index 71da7879..629b40b4 100644
--- a/utils.c
+++ b/utils.c
@@ -1382,7 +1382,7 @@ u64 parse_size(char *s)
char c;
u64 mult = 1;
- for (i=0 ; s[i] && isdigit(s[i]) ; i++) ;
+ for (i = 0; s && s[i] && isdigit(s[i]); i++) ;
if (!i) {
fprintf(stderr, "ERROR: size value is empty\n");
exit(50);