]> Savannah Git Hosting - gnulib.git/commitdiff
inet-ntop, inet-pton: Avoid obsolete u_char type.
authorSimon Josefsson <simon@josefsson.org>
Mon, 6 May 2024 12:56:08 +0000 (14:56 +0200)
committerSimon Josefsson <simon@josefsson.org>
Mon, 6 May 2024 12:56:08 +0000 (14:56 +0200)
* lib/inet_pton.c (inet_pton6): Use unsigned char instead of u_char.
* lib/inet_ntop.c: Doc fix.

ChangeLog
lib/inet_ntop.c
lib/inet_pton.c

index 02ecbd341d1dff201d2180a367b6a65dbee92ed2..6b969dddbe9f999df2690ac9039462a3d5a233b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-06  Simon Josefsson  <simon@josefsson.org>
+
+       inet-ntop, inet-pton: Avoid obsolete u_char type.
+       * lib/inet_pton.c (inet_pton6): Use unsigned char instead of u_char.
+       * lib/inet_ntop.c: Doc fix.
+
 2024-05-05  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Regenerate aclocal.m4 before using 'autoconf -t ...'.
index 0a4ba20e0dbdde4858c4b03fdeeae4e6b3515629..26089959da513438beaab6961aa10913e094a17f 100644 (file)
@@ -117,7 +117,7 @@ inet_ntop (int af, const void *restrict src,
  *      'dst' (as a const)
  * notes:
  *      (1) uses no statics
- *      (2) takes a u_char* not an in_addr as input
+ *      (2) takes a 'unsigned char *' not an in_addr as input
  * author:
  *      Paul Vixie, 1996.
  */
index 2d29608d472b97602165f5b62e04feccdde0cadd..3d35f37adfe7a7cd421e4234a2b60546841815c4 100644 (file)
@@ -217,8 +217,8 @@ inet_pton6 (const char *restrict src, unsigned char *restrict dst)
             }
           if (tp + NS_INT16SZ > endp)
             return (0);
-          *tp++ = (u_char) (val >> 8) & 0xff;
-          *tp++ = (u_char) val & 0xff;
+          *tp++ = (unsigned char) (val >> 8) & 0xff;
+          *tp++ = (unsigned char) val & 0xff;
           saw_xdigit = 0;
           val = 0;
           continue;
@@ -236,8 +236,8 @@ inet_pton6 (const char *restrict src, unsigned char *restrict dst)
     {
       if (tp + NS_INT16SZ > endp)
         return (0);
-      *tp++ = (u_char) (val >> 8) & 0xff;
-      *tp++ = (u_char) val & 0xff;
+      *tp++ = (unsigned char) (val >> 8) & 0xff;
+      *tp++ = (unsigned char) val & 0xff;
     }
   if (colonp != NULL)
     {