]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
res_servicenumber returns -1 on error.
authorMark Andrews <marka@isc.org>
Thu, 3 Jun 2004 04:45:16 +0000 (04:45 +0000)
committerMark Andrews <marka@isc.org>
Thu, 3 Jun 2004 04:45:16 +0000 (04:45 +0000)
lib/bind/resolv/res_mkupdate.c

index dcbedceb3a515a5da946f592652ea292bd9f2da7..0f93d7c73e3304f23dad7279007173dbca24b94d 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.2.3 2004/03/16 12:35:36 marka Exp $";
+static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.2.4 2004/06/03 04:45:16 marka Exp $";
 #endif /* not lint */
 
 #include "port_before.h"
@@ -350,13 +350,13 @@ res_nmkupdate(res_state statp, ns_updrec *rrecp_in, u_char *buf, int buflen) {
                                bm[i] = 0;
 
                        while (getword_str(buf2, sizeof buf2, &startp, endp)) {
-                               if ((n1 = res_servicenumber(buf2)) <= 0)
+                               if ((n = res_servicenumber(buf2)) <= 0)
                                        return (-1);
 
-                               if (n1 < MAXPORT) {
-                                       bm[n1/8] |= (0x80>>(n1%8));
-                                       if (n1 > maxbm)
-                                               maxbm = n1;
+                               if (n < MAXPORT) {
+                                       bm[n/8] |= (0x80>>(n%8));
+                                       if ((unsigned)n > maxbm)
+                                               maxbm = n;
                                } else
                                        return (-1);
                        }