aboutsummaryrefslogtreecommitdiff
path: root/util/cutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cutils.c')
-rw-r--r--util/cutils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/cutils.c b/util/cutils.c
index c442882b88..b425ed6570 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -362,7 +362,6 @@ static int do_strtosz(const char *nptr, const char **end,
}
}
- *result = val;
retval = 0;
out:
@@ -371,6 +370,9 @@ out:
} else if (*endptr) {
retval = -EINVAL;
}
+ if (retval == 0) {
+ *result = val;
+ }
return retval;
}