Re: [PATCH python] Avoid comparing boolean and integers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/09/2017 11:07 AM, Daniel P. Berrange wrote:
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  libvirt-utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Did you get a compiler that complained?

> 
> diff --git a/libvirt-utils.c b/libvirt-utils.c
> index 727397d..0af13dc 100644
> --- a/libvirt-utils.c
> +++ b/libvirt-utils.c
> @@ -108,7 +108,7 @@ virReallocN(void *ptrptr,
>          return -1;
>      }
>      tmp = realloc(*(void**)ptrptr, size * count);
> -    if (!tmp && (size * count)) {
> +    if (!tmp && ((size * count) != 0)) {

Do you need the extra (), or will one of these shorter forms also work?

if (!tmp && size * count != 0)
if (!tmp && (size * count) != 0)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux