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.
This commit is contained in:
Willy Tarreau 2020-08-29 06:44:37 +02:00
parent 9dbb6c43ce
commit 1c34b881c3

View File

@ -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;