mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-15 22:09:31 -04:00
make val unsigned as we are now using strtoul().
This commit is contained in:
parent
828f5c0250
commit
9be230cfca
1 changed files with 5 additions and 5 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rdata.c,v 1.170 2002/03/27 03:31:49 marka Exp $ */
|
||||
/* $Id: rdata.c,v 1.171 2002/03/27 23:31:32 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
#include <ctype.h>
|
||||
|
|
@ -1072,12 +1072,12 @@ dns_rdataclass_fromtext(dns_rdataclass_t *classp, isc_textregion_t *source) {
|
|||
strncasecmp("class", source->base, 5) == 0) {
|
||||
char buf[sizeof("65000")];
|
||||
char *endp;
|
||||
int val;
|
||||
unsigned int val;
|
||||
|
||||
strncpy(buf, source->base + 5, source->length - 5);
|
||||
buf[source->length - 5] = '\0';
|
||||
val = strtoul(buf, &endp, 10);
|
||||
if (*endp == '\0' && val >= 0 && val <= 0xffff) {
|
||||
if (*endp == '\0' && val <= 0xffff) {
|
||||
*classp = (dns_rdataclass_t)val;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
|
@ -1177,12 +1177,12 @@ dns_rdatatype_fromtext(dns_rdatatype_t *typep, isc_textregion_t *source) {
|
|||
strncasecmp("type", source->base, 4) == 0) {
|
||||
char buf[sizeof("65000")];
|
||||
char *endp;
|
||||
int val;
|
||||
unsigned int val;
|
||||
|
||||
strncpy(buf, source->base + 4, source->length - 4);
|
||||
buf[source->length - 4] = '\0';
|
||||
val = strtoul(buf, &endp, 10);
|
||||
if (*endp == '\0' && val >= 0 && val <= 0xffff) {
|
||||
if (*endp == '\0' && val <= 0xffff) {
|
||||
*typep = (dns_rdatatype_t)val;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue