Add a inflateEnd() call to free up the stream in the re-init block.
[obnox/wireshark/wip.git] / epan / inet_aton.c
index e2b66d3fe6c6dcb57551e4954416635bb3930905..331095fd30173426a919938d219cf1ff600340c0 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -43,6 +39,14 @@ static char sccsid[] = "@(#)inet_addr.c      8.1 (Berkeley) 6/17/93";
 #include <sys/param.h>
 #endif
 
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
@@ -51,7 +55,7 @@ static char sccsid[] = "@(#)inet_addr.c       8.1 (Berkeley) 6/17/93";
 
 #include "inet_aton.h"
 
-/* 
+/*
  * Check whether "cp" is a valid ascii representation
  * of an Internet address and convert to a binary address.
  * Returns 1 if the address is valid, 0 if not.
@@ -63,12 +67,12 @@ inet_aton(cp_arg, addr)
        const char *cp_arg;
        struct in_addr *addr;
 {
-       register const guchar *cp = cp_arg;
-       register gulong val;
+       register const u_char *cp = cp_arg;
+       register u_long val;
        register int base, n;
-       register guchar c;
-       guint parts[4];
-       register guint *pp = parts;
+       register u_char c;
+       u_int parts[4];
+       register u_int *pp = parts;
 
        for (;;) {
                /*
@@ -90,7 +94,7 @@ inet_aton(cp_arg, addr)
                                continue;
                        }
                        if (base == 16 && isascii(c) && isxdigit(c)) {
-                               val = (val << 4) + 
+                               val = (val << 4) +
                                        (c + 10 - (islower(c) ? 'a' : 'A'));
                                cp++;
                                continue;
@@ -144,6 +148,6 @@ inet_aton(cp_arg, addr)
                break;
        }
        if (addr)
-               addr->s_addr = g_htonl(val);
+               addr->s_addr = htonl(val);
        return (1);
 }