mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2024-10-26 16:25:10 +03:00
Avoid implicit treatment of an arithmetic result as a boolean
Latest GCC versions are unhappy with us treating an integer arithmetic result as a boolean: libvirt-utils.c: In function ‘virReallocN’: libvirt-utils.c:111:23: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context] if (!tmp && (size * count)) { ~~~~~~^~~~~~~~ Add an explicit comparison '!= 0' to keep it happy, since its suggestion to use '&&' is nonsense. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
75ec2acb61
commit
ac8faf417e
@ -108,7 +108,7 @@ virReallocN(void *ptrptr,
|
||||
return -1;
|
||||
}
|
||||
tmp = realloc(*(void**)ptrptr, size * count);
|
||||
if (!tmp && (size * count)) {
|
||||
if (!tmp && ((size * count) != 0)) {
|
||||
return -1;
|
||||
}
|
||||
*(void**)ptrptr = tmp;
|
||||
|
Loading…
Reference in New Issue
Block a user