mirror of
https://github.com/cc65/cc65.git
synced 2025-08-13 08:25:28 +00:00
reserve enough space for the longest string we can expect
This commit is contained in:
@@ -42,15 +42,18 @@
|
|||||||
/* Code */
|
/* 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)
|
char* __fastcall__ asctime (const struct tm* timep)
|
||||||
{
|
{
|
||||||
static char buf[26];
|
static char buf[38];
|
||||||
|
|
||||||
/* Format into given buffer and return the result */
|
/* Format into given buffer and return the result */
|
||||||
return strftime (buf, sizeof (buf), "%c\n", timep)? buf : 0;
|
return strftime (buf, sizeof (buf), "%c\n", timep)? buf : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user