On Mon, Oct 17, 2016 at 9:29 PM, Eric Blake <ebl...@redhat.com> wrote:
> On 10/17/2016 10:44 AM, Ashijeet Acharya wrote:
>> I think, its better to keep using atoi() and check if it returns a '0'
> Please not atoi(), as it lacks sane error checking. It cannot tell the
> difference between '1' and '1garbage'.  It's obvious that you want to
> treat both '0' and 'name' as an error, but that is not the only error
> you want to flag, thus atoi() is insufficient to flag all the errors you
> want.
Okay, will using qemu_strtol() be any good as I think it has better
error handling support? Otherwise I will resort to passing -ve value
as Kevin suggested earlier.

> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org

Reply via email to