[IRCServices] Re: DALnet-src: Y2K bug in the ircd (dreamforge and below)

Andrew Church achurch at dragonfire.net
Mon Jan 3 11:24:21 PST 2000


>> Well my bug is in the date() function (s_misc.c), where the reply string
>>  is generated:
>>  
>>          (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);
>>  
>>  The "19", for the centuary, is hardcoded.

<rant>
     Is it just me, or is this so completely braindead it's not even funny?
Even assuming this is left over from the original ircd, that's still
post-1990 code, and it would have taken some major guts (or stupidity) to
assume that that code would no longer be in use by 2000.  It doesn't even
take any extra effort to write "%04d" and "lt->tm_year+1900" instead.

     _This_ is why programming should be left to experts.
</rant>

  --Andrew Church
    achurch at dragonfire.net
    http://achurch.dragonfire.net/
---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.