diff options
author | John Ferlan <jferlan@redhat.com> | 2018-09-27 19:54:05 -0400 |
---|---|---|
committer | John Ferlan <jferlan@redhat.com> | 2018-10-01 14:27:42 -0400 |
commit | f0982d5faa72fc6508f005db2c38ef81233ac9c6 (patch) | |
tree | e1da6a3f4246760ebb88e49a453852c862aea62e /tests/commandtest.c | |
parent | 8f3c00c6e8fdd43648600111ee9eccca921ffcc8 (diff) | |
download | libvirt-f0982d5faa72fc6508f005db2c38ef81233ac9c6.tar.gz |
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 <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'tests/commandtest.c')
-rw-r--r-- | tests/commandtest.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |