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.