Back to index

glibc  2.9
bug6.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 
00003 int
00004 main (void)
00005 {
00006   char buf[80];
00007   int i;
00008   int lost = 0;
00009 
00010   scanf ("%2s", buf);
00011   lost |= (buf[0] != 'X' || buf[1] != 'Y' || buf[2] != '\0');
00012   if (lost)
00013     puts ("test of %2s failed.");
00014   scanf (" ");
00015   scanf ("%d", &i);
00016   lost |= (i != 1234);
00017   if (lost)
00018     puts ("test of %d failed.");
00019   scanf ("%c", buf);
00020   lost |= (buf[0] != 'L');
00021   if (lost)
00022     puts ("test of %c failed.\n");
00023 
00024   puts (lost ? "Test FAILED!" : "Test succeeded.");
00025   return lost;
00026 }