09db97d Use explicit boolean comparison in OOM check

Authored and Committed by berrange 7 years ago
    Use explicit boolean comparison in OOM check
    
    GCC 7 gets upset by
    
       if (!tmp && (size * count))
    
    warning
    
      util/viralloc.c: In function 'virReallocN':
      util/viralloc.c:246:23: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
         if (!tmp && (size * count)) {
                     ~~~~~~^~~~~~~~
    
    Keep it happy by adding != 0 to the right hand expression
    so it realizes we really are wanting to treat the result
    of the arithmetic expression as a boolean
    
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
    
        
file modified
+1 -1