#include <isc/lib.h>
#include <isc/log.h>
#include <isc/mem.h>
+#include <isc/parseint.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/timer.h>
bool snset = false;
bool logdump = false;
FILE *errout = stdout;
- char *endp;
outputstyle = &dns_master_style_full;
case 'L':
snset = true;
- endp = NULL;
- serialnum = strtol(isc_commandline_argument, &endp, 0);
- if (*endp != '\0') {
- fprintf(stderr, "source serial number "
- "must be numeric");
+ if (isc_parse_uint32(&serialnum,
+ isc_commandline_argument,
+ 0) != ISC_R_SUCCESS)
+ {
+ fprintf(stderr, "source serial number must be "
+ "a 32-bit unsigned integer\n");
exit(EXIT_FAILURE);
}
break;
case 'l':
zone_options |= DNS_ZONEOPT_CHECKTTL;
- endp = NULL;
- maxttl = strtol(isc_commandline_argument, &endp, 0);
- if (*endp != '\0') {
- fprintf(stderr, "maximum TTL "
- "must be numeric");
+ if (isc_parse_uint32(&maxttl, isc_commandline_argument,
+ 0) != ISC_R_SUCCESS)
+ {
+ fprintf(stderr, "maximum TTL must be a 32-bit "
+ "unsigned integer\n");
exit(EXIT_FAILURE);
}
break;