aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/vsprintf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index cbab1df150cf..017290241261 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -825,6 +825,17 @@ int vsscanf(const char * buf, const char * fmt, va_list args)
825 break; 825 break;
826 str = next; 826 str = next;
827 } 827 }
828
829 /*
830 * Now we've come all the way through so either the input string or the
831 * format ended. In the former case, there can be a %n at the current
832 * position in the format that needs to be filled.
833 */
834 if (*fmt == '%' && *(fmt + 1) == 'n') {
835 int *p = (int *)va_arg(args, int *);
836 *p = str - buf;
837 }
838
828 return num; 839 return num;
829} 840}
830 841