From 1d8dc4293f772369e2da018ba5f1bf6e67967f3a Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 23 Jan 1996 10:00:23 +0000 Subject: Mon Jan 22 10:40:40 1996 Roland McGrath * sysdeps/posix/getcwd.c [__GNU_LIBRARY__]: Include unistd.h. * io/fts.h (FTSENT): Define fts_compar member with prototype. * hurd/hurd.h: Use prototype in getcttyid decl. * stdlib/l64a.c: Fix typo in last change. * stdlib/drand48-iter.c: Test limits.h macros instead of sizeof for determining size of types. * stdlib/srand48_r.c: Likewise. * misc/utmp.h: Declare login, logout, logwtmp. * misc/logout.c: Declare argument as pointer to const. * misc/login.c: Likewise. * misc/logwtmp.c: Likewise. Include time.h, string.h. * misc/efgcvt_r.c: Include stdlib.h. * io/mknod.c: Include sys/types.h. * gmon/sys/gmon.h: Declare monstartup, _mcleanup. * csu/gmon-start.c (_start, etext): Declare with prototypes. * stdio-common/vfscanf.c (%[): Fix range handling. --- stdio-common/vfscanf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'stdio-common') diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c index c7ea4bb5e0..dd635c9f34 100644 --- a/stdio-common/vfscanf.c +++ b/stdio-common/vfscanf.c @@ -724,13 +724,13 @@ __vfscanf (FILE *s, const char *format, va_list argptr) while ((fc = *f++) != '\0' && fc != ']') { - if (*f == '-' && f[1] != '\0' && f[1] != ']' && fc <= f[1]) + if (fc == '-' && *f != '\0' && *f != ']' && + (unsigned char) f[-2] <= (unsigned char) *f) { /* Add all characters from the one before the '-' up to (but not including) the next format char. */ - f++; - while (fc < *f) - wp[fc++] = 1; + for (fc = f[-2]; fc < *f; ++fc) + wp[fc] = 1; } else /* Add the character to the flag map. */ -- cgit v1.2.3-70-g09d2