From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwASK-0001ef-C9 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 12:08:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwASJ-0001xr-9y for qemu-devel@nongnu.org; Mon, 17 Oct 2016 12:08:04 -0400 MIME-Version: 1.0 In-Reply-To: <6246d235-edd5-130f-df71-522b4a3a7ad2@redhat.com> References: <1476522280-23211-1-git-send-email-ashijeetacharya@gmail.com> <1476522280-23211-3-git-send-email-ashijeetacharya@gmail.com> <20161017125724.GG4821@noname.redhat.com> <6246d235-edd5-130f-df71-522b4a3a7ad2@redhat.com> From: Ashijeet Acharya Date: Mon, 17 Oct 2016 21:38:02 +0530 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [v2 2/5] block/ssh: Add InetSocketAddress and accept it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Kevin Wolf , Max Reitz , "Richard W.M. Jones" , jcody@redhat.com, Markus Armbruster , "Daniel P. Berrange" , Gerd Hoffmann , Paolo Bonzini , QEMU Developers , qemu-block@nongnu.org On Mon, Oct 17, 2016 at 9:29 PM, Eric Blake 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. Ashijeet > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >