diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index a68edabb..7628b2d2 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -269,6 +269,11 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t, int ps) else a=r=z=big+sizeof(big)/sizeof(*big) - max_mant_slots - 1; do { + if (z >= big + bufsize) + { + printf("Stack overflow: z=%#lx buf_end(eclusive)=%#lx y=%u\n", + (unsigned long)z, (unsigned long)(big + bufsize), (uint32_t)y); + } *z = y; y = 1000000000*(y-*z++); } while (y);