summaryrefslogtreecommitdiffstats
path: root/bin/date/date.c
diff options
context:
space:
mode:
authorjwd <jwd@FreeBSD.org>2000-07-22 22:08:39 +0000
committerjwd <jwd@FreeBSD.org>2000-07-22 22:08:39 +0000
commit45c2f34531bb3d5e64de8638f105bea9ce92177a (patch)
tree3e2a60301f0091367552df35d6540b672547a2d3 /bin/date/date.c
parentbdf9ed1bd66431cd8bce8550a99e46a60c673e78 (diff)
downloadFreeBSD-src-45c2f34531bb3d5e64de8638f105bea9ce92177a.zip
FreeBSD-src-45c2f34531bb3d5e64de8638f105bea9ce92177a.tar.gz
Expand the -r option to support hex. Though undocumented, the -r
option already supported octal. Add a comment to the -r option in the man page so it's a bit more specific. Discrepancy brought to my attention by: sasdrq@unx.sas.com Approved by: jkh
Diffstat (limited to 'bin/date/date.c')
-rw-r--r--bin/date/date.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/date/date.c b/bin/date/date.c
index 0ee69b7..95d0bae 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -116,7 +116,8 @@ main(argc, argv)
break;
case 'r': /* user specified seconds */
rflag = 1;
- tval = atol(optarg);
+ if (sscanf(optarg,"%li",&tval) != 1)
+ usage();
break;
case 't': /* minutes west of UTC */
/* error check; don't allow "PST" */
OpenPOWER on IntegriCloud