From 53a3630d2cdbee7cee6b4d60c3b4272e73f8c785 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 5 Feb 2020 23:05:33 +0100 Subject: [PATCH] Don't try to allocate a ridiculous 1025 bytes on the stack (which completely explodes on CP/M). --- lang/cem/libcc.ansi/core/printf/doprnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lang/cem/libcc.ansi/core/printf/doprnt.c b/lang/cem/libcc.ansi/core/printf/doprnt.c index 3eae73f0c..df2d557e6 100644 --- a/lang/cem/libcc.ansi/core/printf/doprnt.c +++ b/lang/cem/libcc.ansi/core/printf/doprnt.c @@ -162,7 +162,8 @@ int _doprnt(register const char* fmt, va_list ap) int i, c, width, precision, zfill, flags, between_fill; int nrchars = 0; const char* oldfmt; - char *s1, buf[1025]; + char *s1; + static char buf[16]; /* used to store rendered numbers */ while (c = *fmt++) {