From 3be3ac17e15fea8a29a59e1b9279f9a6455e07ae Mon Sep 17 00:00:00 2001 From: cheloha Date: Tue, 13 Feb 2018 17:28:11 +0000 Subject: [PATCH] atoll -> strtonum ok millert@ tb@ --- bin/date/date.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/date/date.c b/bin/date/date.c index 087da9602da..3a3ff3851a3 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -1,4 +1,4 @@ -/* $OpenBSD: date.c,v 1.51 2017/12/23 20:58:14 cheloha Exp $ */ +/* $OpenBSD: date.c,v 1.52 2018/02/13 17:28:11 cheloha Exp $ */ /* $NetBSD: date.c,v 1.11 1995/09/07 06:21:05 jtc Exp $ */ /* @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -78,7 +79,9 @@ main(int argc, char *argv[]) break; case 'r': /* user specified seconds */ rflag = 1; - tval = atoll(optarg); + tval = strtonum(optarg, LLONG_MIN, LLONG_MAX, &errstr); + if (errstr) + errx(1, "seconds is %s: %s", errstr, optarg); break; case 'u': /* do everything in UTC */ if (setenv("TZ", "UTC", 1) == -1) -- 2.20.1