]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - lib/vsprintf.c
USB: set default y for CONFIG_USB_DEVICE_CLASS
[linux-2.6-omap-h63xx.git] / lib / vsprintf.c
index cbab1df150cfed43bcbd4beeb8d40fe15e7042b5..0172902412613025213c07e7758af9492e2bd761 100644 (file)
@@ -825,6 +825,17 @@ int vsscanf(const char * buf, const char * fmt, va_list args)
                        break;
                str = next;
        }
+
+       /*
+        * Now we've come all the way through so either the input string or the
+        * format ended. In the former case, there can be a %n at the current
+        * position in the format that needs to be filled.
+        */
+       if (*fmt == '%' && *(fmt + 1) == 'n') {
+               int *p = (int *)va_arg(args, int *);
+               *p = str - buf;
+       }
+
        return num;
 }