[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Y2k bug in /date command.
Hi,
I found a year 2000 bug in ircd 2.9.3 and verified
it is still in 2.9.5. This bug will show up in the /date
command and has a simple fix that I have attached (note the
top case contains the fix). The sprintf assumes we are in the
1900's which we are, but not for much longer.
*** s_misc.c.orig Wed Jun 18 11:00:38 1997
--- s_misc.c Wed Mar 11 12:04:44 1998
***************
*** 90,99 ****
--- 90,106 ----
if (minswest < 0)
minswest = -minswest;
+ #ifndef NO_DAVE_BUG_FIX
+ (void)sprintf(buf, "%s %s %d %4d -- %02d:%02d %c%02d:%02d",
+ weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
+ lt->tm_year + 1900, lt->tm_hour, lt->tm_min,
+ plus, minswest/60, minswest%60);
+ #else
(void)sprintf(buf, "%s %s %d 19%02d -- %02d:%02d %c%02d:%02d",
weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
lt->tm_year, lt->tm_hour, lt->tm_min,
plus, minswest/60, minswest%60);
+ #endif
return buf;
}
--
+---------------------oOO--(_)--OOo------------------------+
|Dave Hill (0 0) Unix Software Group |
|Mailstop: ZKO3-3/Y15 \//\/ (dtn) 381-2985 |
|Digital Equipment Corp. (603 )881-2985 |
|110 Spitbrook Road /\//\ enet: ddhill@xxxxxxxxxxx|
|Nashua, NH 03062-2698 (0_0) decnet: gooey::ddhill |
+---------------------oOO--(_)--OOo------------------------+