mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-17 02:20:10 +00:00
fcc10ffab6
* 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.
24 lines
297 B
C
24 lines
297 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
double d;
|
|
int c;
|
|
|
|
if (scanf ("%lg", &d) != 0)
|
|
{
|
|
printf ("scanf didn't failed\n");
|
|
exit (1);
|
|
}
|
|
c = getchar ();
|
|
if (c != ' ')
|
|
{
|
|
printf ("c is `%c', not ` '\n", c);
|
|
exit (1);
|
|
}
|
|
|
|
return 0;
|
|
}
|