Back to index

glibc  2.9
bug22.c
Go to the documentation of this file.
00001 /* BZ #5424 */
00002 #include <stdio.h>
00003 
00004 #define N 2147483648
00005 
00006 #define STRINGIFY(S) #S
00007 #define MAKE_STR(S) STRINGIFY(S)
00008 
00009 #define SN MAKE_STR(N)
00010 
00011 static int
00012 do_test (void)
00013 {
00014   int ret;
00015 
00016   FILE *fp = fopen ("/dev/null", "w");
00017   if (fp == NULL)
00018     {
00019       puts ("cannot open /dev/null");
00020       return 1;
00021     }
00022 
00023   ret = fprintf (fp, "%" SN "d%" SN "d", 1, 1);
00024 
00025   printf ("ret = %d\n", ret);
00026 
00027   return ret != -1;
00028 }
00029 
00030 #define TIMEOUT 30
00031 #define TEST_FUNCTION do_test ()
00032 #include "../test-skeleton.c"