* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dig.c,v 1.156 2001/07/29 23:23:41 bwelling Exp $ */
+/* $Id: dig.c,v 1.157 2001/08/23 04:39:31 marka Exp $ */
#include <config.h>
#include <stdlib.h>
}
static isc_uint32_t
-parse_int(char *arg, const char *desc, isc_uint32_t max) {
+parse_uint(char *arg, const char *desc, isc_uint32_t max) {
char *endp;
isc_uint32_t tmp;
goto need_value;
if (!state)
goto invalid_option;
- lookup->udpsize = (isc_uint16_t) parse_int(value, "buffer size",
- COMMSIZE);
- if (lookup->udpsize <= 0)
- lookup->udpsize = 0;
+ lookup->udpsize = (isc_uint16_t) parse_uint(value,
+ "buffer size", COMMSIZE);
if (lookup->udpsize > COMMSIZE)
lookup->udpsize = COMMSIZE;
break;
goto need_value;
if (!state)
goto invalid_option;
- ndots = parse_int(value, "ndots", MAXNDOTS);
- if (ndots < 0)
- ndots = 0;
+ ndots = parse_uint(value, "ndots", MAXNDOTS);
break;
case 's': /* nssearch */
lookup->ns_search_only = state;
goto need_value;
if (!state)
goto invalid_option;
- timeout = parse_int(value, "timeout", MAXTIMEOUT);
- if (timeout <= 0)
+ timeout = parse_uint(value, "timeout", MAXTIMEOUT);
+ if (timeout == 0)
timeout = 1;
break;
case 'r':
goto need_value;
if (!state)
goto invalid_option;
- lookup->retries = parse_int(value, "retries",
+ lookup->retries = parse_uint(value, "retries",
MAXTRIES);
- if (lookup->retries <= 0)
+ if (lookup->retries == 0)
lookup->retries = 1;
break;
default:
keyfile[sizeof(keyfile)-1]=0;
return (value_from_next);
case 'p':
- port = (in_port_t) parse_int(value, "port number", MAXPORT);
+ port = (in_port_t) parse_uint(value, "port number", MAXPORT);
return (value_from_next);
case 't':
*open_type_class = ISC_FALSE;
(*lookup)->rdtype = dns_rdatatype_ixfr;
(*lookup)->rdtypeset = ISC_TRUE;
(*lookup)->ixfr_serial =
- parse_int(&value[5], "serial number",
+ parse_uint(&value[5], "serial number",
MAXSERIAL);
(*lookup)->section_question = plusquest;
(*lookup)->comments = pluscomm;
lookup->rdtype = dns_rdatatype_ixfr;
lookup->rdtypeset = ISC_TRUE;
lookup->ixfr_serial =
- parse_int(&rv[0][5],
+ parse_uint(&rv[0][5],
"serial number",
MAXSERIAL);
lookup->section_question = plusquest;
isc_app_finish();
return (exitcode);
}
-