mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Update.
* stdio-common/vfscanf.c: Handle input -- with format %f correctly (it's no input error). * stdio-common/tstscanf.c: Add test case for format %f with input --. * stdio-common/scanf12.c: Correct expected result for first scanf.
This commit is contained in:
@@ -277,7 +277,7 @@ main (int argc, char **argv)
|
||||
/* From PR libc/1313 reported by Ben Caradoc-Davies <bmcd@physics.otago.ac.nz>. */
|
||||
float value;
|
||||
int res;
|
||||
|
||||
|
||||
res = sscanf ("0123", "%2f", &value);
|
||||
if (res != 1 || value != 1.0)
|
||||
{
|
||||
@@ -285,6 +285,19 @@ main (int argc, char **argv)
|
||||
result = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fputs ("Test 10:\n", stdout);
|
||||
{
|
||||
float value;
|
||||
int res;
|
||||
|
||||
res = sscanf ("--", "%f", &value);
|
||||
if (res != 0)
|
||||
{
|
||||
fputs ("test failed!\n", stdout);
|
||||
result = 1;
|
||||
}
|
||||
}
|
||||
|
||||
exit (result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user