Do not rely on the underlying type of time_t in date(1) and touch(1)

Use LLONG_MAX unconditionally.  In practice this only causes trouble
with systems that are not 2038 ready.
This commit is contained in:
sin 2015-02-08 23:45:03 +00:00
parent d6b3890af6
commit 8f5d77d8c7
2 changed files with 2 additions and 2 deletions

2
date.c
View File

@ -26,7 +26,7 @@ main(int argc, char *argv[])
t = time(NULL); t = time(NULL);
ARGBEGIN { ARGBEGIN {
case 'd': case 'd':
t = estrtonum(EARGF(usage()), 0, MIN(LLONG_MAX, (time_t)-1)); t = estrtonum(EARGF(usage()), 0, LLONG_MAX);
break; break;
case 'u': case 'u':
tztime = gmtime; tztime = gmtime;

View File

@ -73,7 +73,7 @@ main(int argc, char *argv[])
t = st.st_mtime; t = st.st_mtime;
break; break;
case 't': case 't':
t = estrtonum(EARGF(usage()), 0, MIN(LLONG_MAX, (time_t)-1)); t = estrtonum(EARGF(usage()), 0, LLONG_MAX);
break; break;
default: default:
usage(); usage();