mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-25 10:59:35 -05:00
Change an error message and allow time to be specified as YYYYMMDD
(without HHMMSS).
This commit is contained in:
parent
162095ca41
commit
85e60ef497
1 changed files with 8 additions and 2 deletions
|
|
@ -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 <config.h>
|
||||
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue