From 16bf472e66a215b93391b36b11fded0a7c257f44 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 13 Jul 2022 23:10:19 +0200 Subject: [PATCH] reserve enough space for the longest string we can expect --- libsrc/common/asctime.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libsrc/common/asctime.c b/libsrc/common/asctime.c index 15450425e..b46f29128 100644 --- a/libsrc/common/asctime.c +++ b/libsrc/common/asctime.c @@ -42,15 +42,18 @@ /* Code */ /*****************************************************************************/ +/* + CAUTION: we need to reserve enough space to be able to hold the maximum + length string: + 1234567890123456789012345678901234567 + "Wednesday September ..1 00:00:00 1970" +*/ char* __fastcall__ asctime (const struct tm* timep) { - static char buf[26]; + static char buf[38]; /* Format into given buffer and return the result */ return strftime (buf, sizeof (buf), "%c\n", timep)? buf : 0; } - - -