From 5eaca29fbb103f1d3330e0982c5c18548d37d108 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Tue, 2 Jun 2015 11:17:27 +0200 Subject: [PATCH] virsh: Make vshCommandOptScaledInt() use vshCommandOpt() This aligns it to the other vshCommandOpt*() functions. --- tools/virsh.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 55caa87701..cd2bfef5a7 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1804,16 +1804,16 @@ vshCommandOptScaledInt(const vshCmd *cmd, const char *name, unsigned long long *value, int scale, unsigned long long max) { - const char *str; - int ret; + vshCmdOpt *arg; char *end; + int ret; - ret = vshCommandOptString(cmd, name, &str); - if (ret <= 0) + if ((ret = vshCommandOpt(cmd, name, &arg, true)) <= 0) return ret; - if (virStrToLong_ullp(str, &end, 10, value) < 0 || + if (virStrToLong_ullp(arg->data, &end, 10, value) < 0 || virScaleInteger(value, end, scale, max) < 0) return -1; + return 1; } -- GitLab