]> xenbits.xensource.com Git - libvirt.git/commit
vircapstest: Avoid (im)possible strcmp call with NULL argument
authorJiri Denemark <jdenemar@redhat.com>
Mon, 13 Nov 2017 21:22:07 +0000 (22:22 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 14 Nov 2017 13:45:19 +0000 (14:45 +0100)
commit5f244e3161cc5f75932010e38f0ad58f29bef13e
tree8b21d8af7aa8cb337ebcf13095bc156cd1e0c8e3
parentf9d8b0270ff717c7882c6799e1cafabce11aa69a
vircapstest: Avoid (im)possible strcmp call with NULL argument

Some compilers may get confused and decide we are calling strcmp with
NULL argument from test_virCapsDomainDataLookupLXC. Although this does
not really happen since the call is guarded with
(data->machinetype != expect_machinetype), using STRNEQ_NULLABLE is
easier to understand, less fragile, and doing so makes sure strcmp is
never called with NULL argument.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
tests/vircapstest.c