mktime() did not work for 2-byte machines

This commit is contained in:
ceriel 1990-06-05 12:07:28 +00:00
parent 6df0ecdf8f
commit bea95a4443

View file

@ -101,7 +101,7 @@ mktime(register struct tm *timep)
timep->tm_yday = yday; timep->tm_yday = yday;
timep->tm_wday = (day + 4) % 7; /* day 0 was thursday (4) */ timep->tm_wday = (day + 4) % 7; /* day 0 was thursday (4) */
seconds = ((timep->tm_hour * 60) + timep->tm_min) * 60 + timep->tm_sec; seconds = ((timep->tm_hour * 60L) + timep->tm_min) * 60L + timep->tm_sec;
if ((TIME_MAX - seconds) / SECS_DAY < day) overflow++; if ((TIME_MAX - seconds) / SECS_DAY < day) overflow++;
seconds += day * SECS_DAY; seconds += day * SECS_DAY;