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

Re: [libvirt] [PATCH] util: choose whether to require micro in version strings



On 07/01/2011 10:54 AM, Eric Blake wrote:
> +++ w/src/util/util.c
> @@ -1619,6 +1619,9 @@ virParseVersionString(const char *str, unsigned
> long *version,
>      if ((*tmp == '.') && virStrToLong_ui(tmp + 1, &tmp, 10, &micro) < 0)
>          return -1;
> 
> +    if (major > ULONG_MAX / 1000000 || minor > 999 || micro > 999)

s/ULONG_MAX/UINT_MAX/

to silence a compiler warning, and to deal with the fact that even
though this function populates an 'unsigned long *version', the only
reason it does so is because of our (poor) choice in making
virGetVersion use unsigned long.  But for portability to 32-bit hosts,
we can never exceed a 32-bit version computation, even on hosts where
long is 64-bits.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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