X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2Fvsprintf.c;h=0172902412613025213c07e7758af9492e2bd761;hb=d3f9882cca84a7cb67a19bbc597356b49896b8c2;hp=cbab1df150cfed43bcbd4beeb8d40fe15e7042b5;hpb=98b96173c777c67daaa7d163a35e591e1928a164;p=powerpc.git diff --git a/lib/vsprintf.c b/lib/vsprintf.c index cbab1df150..0172902412 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -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; }