1
0
mirror of https://github.com/moparisthebest/curl synced 2025-01-11 14:08:07 -05:00

connect: silence sign-compare warning

With MinGW-w64 using WinSock, `curl_socklen_t` is signed, while the
result of `sizeof` is unsigned.

Closes https://github.com/curl/curl/pull/4483
This commit is contained in:
Marcel Raad 2019-10-13 11:13:34 +02:00
parent 07e987840c
commit be16d8d994
No known key found for this signature in database
GPG Key ID: FE4D8BC5EE1701DD

View File

@ -665,7 +665,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen,
#endif
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
case AF_UNIX:
if(salen > sizeof(sa_family_t)) {
if(salen > (curl_socklen_t)sizeof(sa_family_t)) {
su = (struct sockaddr_un*)sa;
msnprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path);
}