6 #include <sys/resource.h>
11 enum {n
= 8*1024*1024};
18 return t_error("out of memory");
19 t_setrlim(RLIMIT_STACK
, 100*1024);
21 for (i
= 0; i
< n
; i
++) s
[i
] = '1';
26 * stack overflow if scanf copies s on the stack (glibc)
27 * same issue with %d except then storing the conversion
28 * result is undefined behaviour
30 i
= sscanf(s
, "%f %c", &f
, &c
);
33 t_error("sscanf returned %d, want 2\n", i
);
35 t_error("sscanf(longnum, \"%%f\") read %f, want inf\n", f
);
37 t_error("sscanf(\"1\", %%c) read '%c', want '1'\n", c
);