From: Willy Tarreau Date: Sat, 29 Aug 2020 04:44:37 +0000 (+0200) Subject: BUILD: sock_unix: fix build issue with isdigit() X-Git-Tag: v2.3-dev4~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c34b881c3ed452236822aa458aa0055538a84fa;p=thirdparty%2Fhaproxy.git BUILD: sock_unix: fix build issue with isdigit() Commit 0d06df6 ("MINOR: sock: introduce sock_inet and sock_unix") made use of isdigit() on the UNIX socket path without casting the value to unsigned char, breaking the build on cygwin and possibly other platforms. No backport is needed. --- diff --git a/src/sock_unix.c b/src/sock_unix.c index c4314d2e7f..f68c0073af 100644 --- a/src/sock_unix.c +++ b/src/sock_unix.c @@ -80,7 +80,7 @@ int sock_unix_addrcmp(const struct sockaddr_storage *a, const struct sockaddr_st /* First, check in path "a" */ if (au->sun_path[idx] != 0) { - for (idx2 = dot + 1; idx2 && isdigit(au->sun_path[idx2]);) + for (idx2 = dot + 1; idx2 && isdigit((unsigned char)au->sun_path[idx2]);) idx2++; if (strcmp(au->sun_path + idx2, ".tmp") != 0) return -1; @@ -88,7 +88,7 @@ int sock_unix_addrcmp(const struct sockaddr_storage *a, const struct sockaddr_st /* Then check in path "b" */ if (bu->sun_path[idx] != 0) { - for (idx2 = dot + 1; idx2 && isdigit(bu->sun_path[idx2]); idx2++) + for (idx2 = dot + 1; idx2 && isdigit((unsigned char)bu->sun_path[idx2]); idx2++) ; if (strcmp(bu->sun_path + idx2, ".tmp") != 0) return -1;