X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/4a56a28ac439137ba2b71fcb5952b4e4abd1e2fc..8f460dd07d9ededc2c2b2a8dc99f025f494716f9:/sbr/dtime.c?ds=sidebyside diff --git a/sbr/dtime.c b/sbr/dtime.c index b3ca012a..56d874e0 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -7,6 +7,7 @@ #include /* for snprintf() */ #include +#include #include #include @@ -178,15 +179,15 @@ dgmtime (time_t *clock) char * dctime (struct tws *tw) { - static char buffer[64]; + static char buffer[26]; if (!tw) return NULL; - snprintf (buffer, sizeof(buffer), "%.3s %.3s %02d %02d:%02d:%02d %.4d\n", + snprintf (buffer, sizeof(buffer), "%.3s %.3s %02d %02d:%02d:%02d %s\n", tw_dotw[tw->tw_wday], tw_moty[tw->tw_mon], tw->tw_mday, tw->tw_hour, tw->tw_min, tw->tw_sec, - tw->tw_year < 100 ? tw->tw_year + 1900 : tw->tw_year); + m_strn(tw->tw_year < 100 ? tw->tw_year + 1900 : tw->tw_year, 4)); return buffer; }