From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyKLD-0003DY-Tz for qemu-devel@nongnu.org; Fri, 17 Feb 2012 04:43:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyKL9-0002hU-Pg for qemu-devel@nongnu.org; Fri, 17 Feb 2012 04:42:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyKL9-0002hN-Gq for qemu-devel@nongnu.org; Fri, 17 Feb 2012 04:42:55 -0500 Date: Fri, 17 Feb 2012 11:42:56 +0200 From: "Michael S. Tsirkin" Message-ID: <20120217094255.GA31366@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 2/2] pci: rewrite devaddr parsing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org On Thu, Feb 16, 2012 at 11:23:40PM +0400, malc wrote: > > +{ > > + unsigned dom, bus, slot, func; > > + int n = -1; > > + > > + /* Parse [[:]:] */ > > + sscanf(addr, "%x:%x:%x%n", &dom, &bus, &slot, &n); > > sscanf can fail. > > > + if (n == -1) { If it does n will stay -1.