aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 39ef581cc1..37d1afb839 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -370,10 +370,14 @@ static int add_old_style_options(const char *fmt, QemuOpts *opts,
static int64_t cvtnum(const char *s)
{
- int64_t ret;
+ int err;
+ int64_t value;
- ret = qemu_strtosz(s, NULL);
- return ret;
+ err = qemu_strtosz(s, NULL, &value);
+ if (err < 0) {
+ return err;
+ }
+ return value;
}
static int img_create(int argc, char **argv)