From 8f5d77d8c7c92c0cb7936c234c4decee579c60a6 Mon Sep 17 00:00:00 2001 From: sin Date: Sun, 8 Feb 2015 23:45:03 +0000 Subject: [PATCH] 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. --- date.c | 2 +- touch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/date.c b/date.c index 467270e..db69091 100644 --- a/date.c +++ b/date.c @@ -26,7 +26,7 @@ main(int argc, char *argv[]) t = time(NULL); ARGBEGIN { case 'd': - t = estrtonum(EARGF(usage()), 0, MIN(LLONG_MAX, (time_t)-1)); + t = estrtonum(EARGF(usage()), 0, LLONG_MAX); break; case 'u': tztime = gmtime; diff --git a/touch.c b/touch.c index 81c470c..536807a 100644 --- a/touch.c +++ b/touch.c @@ -73,7 +73,7 @@ main(int argc, char *argv[]) t = st.st_mtime; break; case 't': - t = estrtonum(EARGF(usage()), 0, MIN(LLONG_MAX, (time_t)-1)); + t = estrtonum(EARGF(usage()), 0, LLONG_MAX); break; default: usage();