sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 8f5d77d8c7c92c0cb7936c234c4decee579c60a6
parent d6b3890af618511a4930cf4c6cc8b72a4c767769
Author: sin <sin@2f30.org>
Date:   Sun,  8 Feb 2015 23:45:03 +0000

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.

Diffstat:
Mdate.c | 2+-
Mtouch.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 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 @@ -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();