On Fri, 17 Feb 2012, Michael S. Tsirkin wrote: > On Thu, Feb 16, 2012 at 11:23:40PM +0400, malc wrote: > > > +{ > > > + unsigned dom, bus, slot, func; > > > + int n = -1; > > > + > > > + /* Parse [[<domain>:]<bus>:]<slot> */ > > > + sscanf(addr, "%x:%x:%x%n", &dom, &bus, &slot, &n); > > > > sscanf can fail. > > > > > + if (n == -1) { > > > If it does n will stay -1. >
You are right. That does not, however, invalidate the points made by Eric Blake. -- mailto:av1...@comtv.ru