From 2adbe3be9e278cfc66289bbd9c8c433db84d5ce4 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Mon, 6 May 2024 14:56:08 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/inet_ntop.c | 2 +- lib/inet_pton.c | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02ecbd341d..6b969dddbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-05-06 Simon Josefsson + + 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 gnulib-tool.py: Regenerate aclocal.m4 before using 'autoconf -t ...'. diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c index 0a4ba20e0d..26089959da 100644 --- a/lib/inet_ntop.c +++ b/lib/inet_ntop.c @@ -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. */ diff --git a/lib/inet_pton.c b/lib/inet_pton.c index 2d29608d47..3d35f37adf 100644 --- a/lib/inet_pton.c +++ b/lib/inet_pton.c @@ -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) { -- 2.39.5