]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
checkpoint
authorMark Andrews <marka@isc.org>
Tue, 3 Apr 2001 07:21:35 +0000 (07:21 +0000)
committerMark Andrews <marka@isc.org>
Tue, 3 Apr 2001 07:21:35 +0000 (07:21 +0000)
lib/bind/inet/inet_addr.c
lib/bind/inet/inet_cidr_pton.c
lib/bind/inet/inet_net_pton.c

index c978a8771b0e64c6ec3ee982d055703e731ab36f..98eea4c59166b25e0059939aed0d7a1428586d6f 100644 (file)
@@ -70,7 +70,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static const char sccsid[] = "@(#)inet_addr.c  8.1 (Berkeley) 6/17/93";
-static const char rcsid[] = "$Id: inet_addr.c,v 1.1 2001/03/29 06:31:37 marka Exp $";
+static const char rcsid[] = "$Id: inet_addr.c,v 1.2 2001/04/03 07:21:32 marka Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include "port_before.h"
@@ -121,7 +121,7 @@ inet_aton(const char *cp, struct in_addr *addr) {
                 * Values are specified as for C:
                 * 0x=hex, 0=octal, isdigit=decimal.
                 */
-               if (!isdigit(c))
+               if (!isdigit((unsigned char)c))
                        return (0);
                val = 0; base = 10; digit = 0;
                if (c == '0') {
@@ -134,15 +134,16 @@ inet_aton(const char *cp, struct in_addr *addr) {
                        }
                }
                for (;;) {
-                       if (isascii(c) && isdigit(c)) {
+                       if (isascii(c) && isdigit((unsigned char)c)) {
                                if (base == 8 && (c == '8' || c == '9'))
                                        return (0);
                                val = (val * base) + (c - '0');
                                c = *++cp;
                                digit = 1;
-                       } else if (base == 16 && isascii(c) && isxdigit(c)) {
+                       } else if (base == 16 && isascii(c) && 
+                                  isxdigit((unsigned char)c)) {
                                val = (val << 4) |
-                                       (c + 10 - (islower(c) ? 'a' : 'A'));
+                                       (c + 10 - (islower((unsigned char)c) ? 'a' : 'A'));
                                c = *++cp;
                                digit = 1;
                        } else
@@ -165,7 +166,7 @@ inet_aton(const char *cp, struct in_addr *addr) {
        /*
         * Check for trailing characters.
         */
-       if (c != '\0' && (!isascii(c) || !isspace(c)))
+       if (c != '\0' && (!isascii(c) || !isspace((unsigned char)c)))
                return (0);
        /*
         * Did we get a valid digit?
index 67e222bf567a3fad50ab2f9a15f881c068a875db..b1f2f092ae6d9daa29c82b51dc84f04258687175 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.1 2001/03/29 06:31:37 marka Exp $";
+static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.2 2001/04/03 07:21:34 marka Exp $";
 #endif
 
 #include "port_before.h"
@@ -101,7 +101,8 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, int *pbits) {
 
        /* Get the prefix length if any. */
        bits = -1;
-       if (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {
+       if (ch == '/' && isascii((unsigned char)(src[0])) &&
+           isdigit((unsigned char)(src[0])) && dst > odst) {
                /* CIDR width specifier.  Nothing can follow it. */
                ch = *src++;    /* Skip over the /. */
                bits = 0;
index 02c6bb410ee1de27fa1795a58c6b3e410435126f..5fa3939253d408904331f66c9a92a3aabdd9864b 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_net_pton.c,v 1.3 2001/04/03 06:42:19 marka Exp $";
+static const char rcsid[] = "$Id: inet_net_pton.c,v 1.4 2001/04/03 07:21:35 marka Exp $";
 #endif
 
 #include "port_before.h"
@@ -159,7 +159,8 @@ inet_net_pton_ipv4(src, dst, size)
                goto enoent;
 
        bits = -1;
-       if (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {
+       if (ch == '/' && isascii((unsigned char)(src[0])) &&
+           isdigit((unsigned char)(src[0])) && dst > odst) {
                /* CIDR width specifier.  Nothing can follow it. */
                ch = *src++;    /* Skip over the /. */
                bits = 0;