diff --git a/src/syncterm/term.c b/src/syncterm/term.c index ae7c6c38b8e3a47111941bb7cfb2e9cf63c06502..3539e7b26f010e534d0c54f4a8f4823efbae82b8 100644 --- a/src/syncterm/term.c +++ b/src/syncterm/term.c @@ -2273,7 +2273,10 @@ capture_control(struct bbslist *bbs) if ((tm = localtime(&t)) != NULL) { // The null-terminator // overwrites the first // byte of filesize - snprintf(sauce.date, sizeof(sauce.date), "%04u%02u%02u", + // We can't use snprintf() here because snprintf() + // Is guaranteed to terminate, so the last digit + // would always be truncated. + sprintf(sauce.date, sizeof(sauce.date), "%04u%02u%02u", 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday); } sauce.filesize = LE_INT32(ftell(fp)); // LE