On 05/29/2014 05:47 AM, Peter Krempa wrote:
Still not quite right ... vshCommandOptUInt currently wraps negative
numbers to their 2's complement and stores them in the uint.
I recently tweaked virstring.c to provide virStrToLong_uip and friends
for rejecting negative input when parsing unsigned numbers.
The intent was that we need to make a case-by-case decision on which of
the two parsing styles to use - sometimes, wrapping -1 to max is
desirable, other times it is not.
We need to modify the vshCommandOptUInt helper to reject negative numbers.
It may mean that we need two flavors of vshCommandOptUInt.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org