From: Peter Krempa Date: Tue, 17 Aug 2021 12:24:13 +0000 (+0200) Subject: testQemuInfoSetArgs: Move argument fetching to the loop X-Git-Tag: v7.7.0-rc1~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ceb802ad9b72b0716d51b0ddf6be1cc99c54a98;p=thirdparty%2Flibvirt.git testQemuInfoSetArgs: Move argument fetching to the loop Since the last patch removed the hack which needed lookahead to see whether all QEMU_CAPS_ were parsed we can move the fetching of the arguments into the loop. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index c86f7f2e39..5ff373e954 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -697,8 +697,7 @@ testQemuInfoSetArgs(struct testQemuInfo *info, abort(); va_start(argptr, capslatest); - argname = va_arg(argptr, testQemuInfoArgName); - while (argname != ARG_END) { + while ((argname = va_arg(argptr, testQemuInfoArgName)) != ARG_END) { switch (argname) { case ARG_QEMU_CAPS: fakeCapsUsed = true; @@ -740,8 +739,6 @@ testQemuInfoSetArgs(struct testQemuInfo *info, fprintf(stderr, "Unexpected test info argument"); goto cleanup; } - - argname = va_arg(argptr, testQemuInfoArgName); } if (!!capsarch ^ !!capsver) {