Back to index

glibc  2.9
bug9.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <string.h>
00003 
00004 int
00005 main(int argc, char *argv[])
00006 {
00007   char buf[100];
00008   int a, b;
00009   int status = 0;
00010 
00011   sscanf ("12ab", "%dab%n", &a, &b);
00012   sprintf (buf, "%d, %d", a, b);
00013   puts (buf);
00014   status |= strcmp (buf, "12, 4");
00015 
00016   sscanf ("12ab100", "%dab%n100", &a, &b);
00017   sprintf (buf, "%d, %d", a, b);
00018   puts (buf);
00019   status |= strcmp (buf, "12, 4");
00020 
00021   return status;
00022 }