]>
git.ipfire.org Git - thirdparty/glibc.git/blob - stdio-common/bug23-4.c
4 #include <sys/resource.h>
12 getrlimit (RLIMIT_STACK
, &lim
);
13 lim
.rlim_cur
= 1048576;
14 setrlimit (RLIMIT_STACK
, &lim
);
15 char *fmtstr
= malloc (4 * LIMIT
+ 1);
18 char *output
= malloc (LIMIT
+ 1);
21 for (size_t i
= 0; i
< LIMIT
; i
++)
22 memcpy (fmtstr
+ 4 * i
, "%1$d", 4);
23 fmtstr
[4 * LIMIT
] = '\0';
24 int ret
= snprintf (output
, LIMIT
+ 1, fmtstr
, 0);
27 for (size_t i
= 0; i
< LIMIT
; i
++)