summaryrefslogtreecommitdiffstats
path: root/lib/strutils.c
diff options
context:
space:
mode:
authorKarel Zak2014-03-11 12:59:42 +0100
committerKarel Zak2014-03-11 12:59:42 +0100
commit5296523d6b3c90947c4ed5f0038728bcba388c49 (patch)
treee518fbd543ffb35505ea6a95484fd42450f7133c /lib/strutils.c
parenttests: update fdisk MBR and SUN tests (diff)
downloadkernel-qcow2-util-linux-5296523d6b3c90947c4ed5f0038728bcba388c49.tar.gz
kernel-qcow2-util-linux-5296523d6b3c90947c4ed5f0038728bcba388c49.tar.xz
kernel-qcow2-util-linux-5296523d6b3c90947c4ed5f0038728bcba388c49.zip
lib/strutils: fix parse_size() return code
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/strutils.c')
-rw-r--r--lib/strutils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/strutils.c b/lib/strutils.c
index fe1102610..450f2f3e3 100644
--- a/lib/strutils.c
+++ b/lib/strutils.c
@@ -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
*