summaryrefslogtreecommitdiff
path: root/dist/bind/lib
diff options
context:
space:
mode:
authorbjh21 <bjh21@NetBSD.org>2002-03-09 13:22:52 +0000
committerbjh21 <bjh21@NetBSD.org>2002-03-09 13:22:52 +0000
commitdca4ae94d6ed60958ecd2fcf690e6caf3e2dcd36 (patch)
treef5ed6b6f6e1f987b22abbcfe2a6f9167d1e5b301 /dist/bind/lib
parentd77463efdec8b970f01fc8ff01b5953d8c55195d (diff)
When checking that a potentially-unsigned enum is >= 0, assign it to an int
first. This is necessary to avoid warnings with -fshort-enums. Casting to an int really should be enough, but turns out not to be. This change will be documented in doc/HACKS.
Diffstat (limited to 'dist/bind/lib')
-rw-r--r--dist/bind/lib/nameser/ns_parse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dist/bind/lib/nameser/ns_parse.c b/dist/bind/lib/nameser/ns_parse.c
index 25bb988dda1..cbe510604de 100644
--- a/dist/bind/lib/nameser/ns_parse.c
+++ b/dist/bind/lib/nameser/ns_parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ns_parse.c,v 1.2 2001/01/27 07:22:05 itojun Exp $ */
+/* $NetBSD: ns_parse.c,v 1.3 2002/03/09 13:22:52 bjh21 Exp $ */
/*
* Copyright (c) 1996,1999 by Internet Software Consortium.
@@ -134,9 +134,10 @@ ns_initparse(const u_char *msg, int msglen, ns_msg *handle) {
int
ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
int b;
+ int tmp;
/* Make section right. */
- if (section < 0 || section >= ns_s_max)
+ if ((tmp = section) < 0 || section >= ns_s_max)
RETERR(ENODEV);
if (section != handle->_sect)
setsection(handle, section);