1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00
2000-05-22  Jakub Jelinek <jakub@redhat.com>

	* stdio-common/vfscanf.c (__vfscanf): Remove bogus check if '-' is
	not the second character in the range.
	* stdio-common/tstscanf.c (main): Add testcase for the above.
	Reported by jik@kamens.brookline.ma.us.
This commit is contained in:
Ulrich Drepper
2000-05-22 16:41:59 +00:00
parent 6aa29abe9f
commit 3f651a4de3
3 changed files with 16 additions and 3 deletions

View File

@ -1657,9 +1657,8 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
++f;
}
tw = (char *) f;
while ((fc = *f++) != '\0' && fc != ']')
if (fc == '-' && *f != '\0' && *f != ']' && f - 2 != tw
if (fc == '-' && *f != '\0' && *f != ']'
&& (unsigned char) f[-2] <= (unsigned char) *f)
{
/* Add all characters from the one before the '-'