From: John Ferlan Date: Thu, 27 Sep 2018 23:54:05 +0000 (-0400) Subject: tests: Use STRNEQ_NULLABLE X-Git-Tag: v4.9.0-rc1~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0982d5faa72fc6508f005db2c38ef81233ac9c6;p=thirdparty%2Flibvirt.git tests: Use STRNEQ_NULLABLE It's possible that the @outbuf and/or @errbuf could be NULL and thus we need to use the right comparison macro. Found by Coverity Signed-off-by: John Ferlan ACKed-by: Michal Privoznik --- diff --git a/tests/commandtest.c b/tests/commandtest.c index 8aa1fdc84e..4d9a468db2 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -875,12 +875,12 @@ static int test21(const void *unused ATTRIBUTE_UNUSED) if (virTestGetVerbose()) printf("STDOUT:%s\nSTDERR:%s\n", NULLSTR(outbuf), NULLSTR(errbuf)); - if (STRNEQ(outbuf, outbufExpected)) { + if (STRNEQ_NULLABLE(outbuf, outbufExpected)) { virTestDifference(stderr, outbufExpected, outbuf); goto cleanup; } - if (STRNEQ(errbuf, errbufExpected)) { + if (STRNEQ_NULLABLE(errbuf, errbufExpected)) { virTestDifference(stderr, errbufExpected, errbuf); goto cleanup; }