Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!nikhefh!n62 From: n62@nikhefh.hep.nl (Klamer Schutte) Newsgroups: comp.os.minix Subject: bug in ctime(3) -- ST version Message-ID: <198@nikhefh.hep.nl> Date: 30 May 89 15:36:34 GMT Reply-To: n62@nikhefh.hep.nl (Klamer Schutte) Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 30 I found the following bug in ctime.c: It always prints Thu (thursday) as the day. Here is my fix: (.signature at end ) *** ctime.c~ Tue May 30 12:05:43 1989 --- ctime.c Tue May 30 12:12:49 1989 *************** *** 55,62 **** tm.tm_min++; } tm.tm_sec = (int) t; ! sprintf(buf, "%s %s %2d %02d:%02d:%02d %d\n", ! days[(t / DAY) % 7], months[tm.tm_mon], tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year); return buf; } --- 55,63 ---- tm.tm_min++; } tm.tm_sec = (int) t; ! /* t is changed so use *pt for the name of the day */ ! sprintf(buf, "%s %s %2d %02d:%02d:%02d %d\n", ! days[(*pt / DAY) % 7], months[tm.tm_mon], tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tm.tm_year); return buf; } -- ________________________________________________________________________________ Klamer Schutte mcvax!nikhefh!n62 n62@nikhefh.hep.nl