From: Thomas Huth Date: Mon, 9 Jan 2023 10:13:06 +0000 (+0100) Subject: tests/qtest/test-hmp: Improve the check for verbose mode X-Git-Tag: v8.0.0-rc0~89^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eb71c6a1e917f3a6ece71593ff44de6eae8bba9;p=thirdparty%2Fqemu.git tests/qtest/test-hmp: Improve the check for verbose mode Running the test-hmp with V=2 up to V=9 runs the test in verbose mode, but running for example with V=10 falls back to non-verbose mode ... Improve this oddity by properly treating the argument as a number. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230109101306.271444-1-thuth@redhat.com> Signed-off-by: Laurent Vivier --- diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c index f8b22abe4ca..b4a920df898 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -151,7 +151,7 @@ int main(int argc, char **argv) { char *v_env = getenv("V"); - if (v_env && *v_env >= '2') { + if (v_env && atoi(v_env) >= 2) { verbose = true; }