mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Updated from ../gpl2lgpl.sed /home/gd/gnu/lib/error.c
This commit is contained in:
4085
stdio-common/tfformat.c
Normal file
4085
stdio-common/tfformat.c
Normal file
File diff suppressed because it is too large
Load Diff
5055
stdio-common/tiformat.c
Normal file
5055
stdio-common/tiformat.c
Normal file
File diff suppressed because it is too large
Load Diff
40
stdio-common/tstdiomisc.c
Normal file
40
stdio-common/tstdiomisc.c
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
t1 ()
|
||||
{
|
||||
int n = -1;
|
||||
sscanf ("abc ", "abc %n", &n);
|
||||
printf ("t1: count=%d\n", n);
|
||||
}
|
||||
|
||||
void
|
||||
t2 ()
|
||||
{
|
||||
int n;
|
||||
long N;
|
||||
int retval;
|
||||
#define SCAN(INPUT, FORMAT, VAR) \
|
||||
VAR = -1; \
|
||||
retval = sscanf (INPUT, FORMAT, &VAR); \
|
||||
printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \
|
||||
INPUT, FORMAT, retval, VAR);
|
||||
|
||||
SCAN ("12345", "%ld", N);
|
||||
SCAN ("12345", "%llllld", N);
|
||||
SCAN ("12345", "%LLLLLd", N);
|
||||
SCAN ("test ", "%*s%n", n);
|
||||
SCAN ("test ", "%2*s%n", n);
|
||||
SCAN ("12 ", "%l2d", n);
|
||||
SCAN ("12 ", "%2ld", N);
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
t1 ();
|
||||
t2 ();
|
||||
|
||||
fflush (stdout);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user