49f71b9cd5
Fix multiple issues: - Remove bogus 2038 check and add overflow checks in the appropriate places. - Correct incomplete leap year calculation that broke things after 2100. - Check localtime return values - Change int calculations to time_t to avoid oveflow. - Consistently check/return -1 and remove bogus comment about not being able to return -1. Now: $ date -d 20991201 Tue Dec 1 00:00:00 EST 2099 $ date -d 40991201 Tue Dec 1 00:00:00 EST 4099 $ date -d 10000000991201 Tue Dec 1 00:00:00 EST 1000000099 TIME=0:04.48 CPU=117.8% (5.288u 0.000s) SWAPS=0 (0+95)pf (0i+0o) (0Kc+0Kd) $ date -d 100000000991201 date: Cannot parse `100000000991201' TIME=0:53.48 CPU=99.2% (53.086u 0.000s) SWAPS=0 (0+96)pf (0i+0o) (0Kc+0Kd) Exit 1 |
||
---|---|---|
.. | ||
compat | ||
disklabel_dkcksum.3 | ||
disklabel_dkcksum.c | ||
disklabel_scan.3 | ||
disklabel_scan.c | ||
efun.3 | ||
efun.c | ||
getbootfile.3 | ||
getbootfile.c | ||
getlabelsector.3 | ||
getlabelsector.c | ||
getmaxpartitions.3 | ||
getmaxpartitions.c | ||
getmntopts.3 | ||
getmntopts.c | ||
getrawpartition.3 | ||
getrawpartition.c | ||
if_media.c | ||
login_cap.3 | ||
login_cap.c | ||
login_tty.c | ||
login.3 | ||
login.c | ||
loginx.3 | ||
loginx.c | ||
logout.c | ||
logoutx.c | ||
logwtmp.c | ||
logwtmpx.c | ||
Makefile | ||
opendisk.3 | ||
opendisk.c | ||
openpty.3 | ||
parsedate.3 | ||
parsedate.y | ||
passwd.c | ||
pidfile.3 | ||
pidfile.c | ||
pidlock.3 | ||
pidlock.c | ||
pty.c | ||
pw_getconf.3 | ||
pw_init.3 | ||
pw_lock.3 | ||
raise_default_signal.3 | ||
raise_default_signal.c | ||
secure_path.3 | ||
secure_path.c | ||
shlib_version | ||
snprintb.3 | ||
sockaddr_snprintf.3 | ||
sockaddr_snprintf.c | ||
stat_flags.3 | ||
stat_flags.c | ||
ttyaction.3 | ||
ttyaction.c | ||
ttymsg.3 | ||
ttymsg.c | ||
util.3 |