From 85e60ef497757d7738569a809d2baa141fc3574c Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 6 Nov 2000 17:28:24 +0000 Subject: [PATCH] Change an error message and allow time to be specified as YYYYMMDD (without HHMMSS). --- bin/dnssec/dnssectool.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c index ffe011f9b0..edefaa6208 100644 --- a/bin/dnssec/dnssectool.c +++ b/bin/dnssec/dnssectool.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dnssectool.c,v 1.22 2000/09/26 22:11:24 bwelling Exp $ */ +/* $Id: dnssectool.c,v 1.23 2000/11/06 17:28:24 bwelling Exp $ */ #include @@ -316,10 +316,16 @@ strtotime(char *str, isc_int64_t now, isc_int64_t base) { if (*endp != '\0') fatal("time value %s is invalid", str); val = now + offset; + } else if (strlen(str) == 8) { + char timestr[15]; + sprintf(timestr, "%s000000", str); + result = dns_time64_fromtext(timestr, &val); + if (result != ISC_R_SUCCESS) + fatal("time value %s is invalid", str); } else { result = dns_time64_fromtext(str, &val); if (result != ISC_R_SUCCESS) - fatal("time %s must be numeric", str); + fatal("time value %s is invalid", str); } return ((isc_stdtime_t) val);