From a8e2b7557d99719bf89baee473c4db736745d158 Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Thu, 15 Mar 2001 19:31:09 +0000 Subject: Fix bug with %c... takes care of bug reported with busybox ps. --- libc/stdio/scanf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libc/stdio') diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c index 7070727d9..dbb6f8d61 100644 --- a/libc/stdio/scanf.c +++ b/libc/stdio/scanf.c @@ -299,10 +299,13 @@ va_list ap; scan_ungetc(&sc); } if (p-spec < 5) { /* [,c,s - string conversions */ - if ((*p == 'c') && (sc.width == INT_MAX)) { - sc.width = 1; - } invert = 0; + if (*p == 'c') { + invert = 1; + if (sc.width == INT_MAX) { + sc.width = 1; + } + } for (i=0 ; i<= UCHAR_MAX ; i++) { scanset[i] = ((*p == 's') ? (isspace(i) == 0) : 0); } -- cgit v1.2.3