mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Fri Dec 22 00:38:00 1995 H.J. Lu <hjl@nynexst.com>
* stdio-common/vfscanf.c: Correctly handle white space skipping. * stdio-common/Makefile (tests): Add bug11. * stdio-common/bug11.c: New file. Fri Dec 22 00:38:00 1995 H.J. Lu <hjl@nynexst.com> * stdio-common/vfscanf.c: Correctly handle white space skipping. * stdio-common/Makefile (tests): Add bug11. * stdio-common/bug11.c: New file.
This commit is contained in:
@@ -39,7 +39,7 @@ distribute := _itoa.h printf-parse.h
|
||||
tests := tst-printf tstscanf test_rdwr test-popen tstgetln test-fseek \
|
||||
temptest tst-fileno test-fwrite \
|
||||
xbug errnobug \
|
||||
bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 \
|
||||
bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 \
|
||||
tfformat tiformat tstdiomisc
|
||||
|
||||
|
||||
|
13
stdio-common/bug11.c
Normal file
13
stdio-common/bug11.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
main ()
|
||||
{
|
||||
int ret;
|
||||
char buf [1024] = "Ooops";
|
||||
|
||||
ret = sscanf ("static char Term_bits[] = {", "static char %s = {", buf);
|
||||
printf ("ret: %d, name: %s\n", ret, buf);
|
||||
|
||||
return strcmp (buf, "Term_bits[]") != 0 || ret != 1;
|
||||
}
|
@@ -233,9 +233,8 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
|
||||
if (c == EOF)
|
||||
input_error ();
|
||||
|
||||
/* We saw an white space as the last character in the format
|
||||
string. Now it's time to skip all leading white
|
||||
spaces. */
|
||||
/* We saw white space char as the last character in the format
|
||||
string. Now it's time to skip all leading white space. */
|
||||
if (skip_space)
|
||||
{
|
||||
while (isspace (c))
|
||||
@@ -243,7 +242,7 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
|
||||
skip_space = 0;
|
||||
}
|
||||
|
||||
else if (c == fc)
|
||||
if (c == fc)
|
||||
(void) inchar ();
|
||||
else
|
||||
conv_error ();
|
||||
|
Reference in New Issue
Block a user