From: Ján Tomko Date: Tue, 13 Mar 2018 09:38:48 +0000 (+0100) Subject: qemuDomainUSBAddressAddHubs: use numeric comparison X-Git-Tag: v4.2.0-rc1~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ab25747319f2c4f37c702a0b0a2e31ee3a60dab;p=thirdparty%2Flibvirt.git qemuDomainUSBAddressAddHubs: use numeric comparison Since data.count is not a pointer, but an integer, compare it against an integer value instead of using the implicit "boolean" conversion that is customarily used for pointers. Signed-off-by: Ján Tomko --- diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 3fcb36add4..5f4e8edd2c 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2701,7 +2701,7 @@ qemuDomainUSBAddressAddHubs(virDomainDefPtr def) &data, false)); - if (data.count && !virDomainDefHasUSB(def)) { + if (data.count > 0 && !virDomainDefHasUSB(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("USB is disabled for this domain, but USB devices " "are present in the domain XML"));