July 22, 2004
2:30 p.m.
Code in "asctime" such as... { long y; y = timeptr->tm_year + (long) TM_YEAR_BASE; if (y >= -999 && y <= 9999) (void) sprintf(buf, "%.3s %.3s%3d %02d:%02d:%02d %ld\n", wn, mn, timeptr->tm_mday, timeptr->tm_hour, timeptr->tm_min, timeptr->tm_sec, y); else (void) sprintf(buf, "%.3s %.3s%3d %ld\n", wn, mn, timeptr->tm_mday, y); } ...never returns NULL and never (when applied to a "struct tm" derived from a 64-bit time_t) overflows a 26-character buffer passed to asctime. It does lose time-of-day information in the distant past and distant future. --ado