]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/strutils: fix parse_size() return code
authorKarel Zak <kzak@redhat.com>
Tue, 11 Mar 2014 11:59:42 +0000 (12:59 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 11 Mar 2014 11:59:42 +0000 (12:59 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/strutils.c

index fe1102610600f9623b6a88b9ed5ee0a6e4bbd526..450f2f3e3b4bab3badeb882334b280623264e5bc 100644 (file)
@@ -66,8 +66,10 @@ int parse_size(const char *str, uintmax_t *res, int *power)
 
        *res = 0;
 
-       if (!str || !*str)
+       if (!str || !*str) {
+               rc = -EINVAL;
                goto err;
+       }
 
        /* Only positive numbers are acceptable
         *