The MinGW.org Windows System Libraries
Revision | 2821f57617d6ce94e7cfb218a9fc88559bd6260f (tree) |
---|---|
Time | 2020-07-06 06:32:09 |
Author | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Revert typedef of socklen_t to signed int type.
@@ -1,3 +1,13 @@ | ||
1 | +2020-07-05 Keith Marshall <keith@users.osdn.me> | |
2 | + | |
3 | + Revert typedef of socklen_t to signed int type. | |
4 | + | |
5 | + * include/ws2tcpip.h (socklen_t): Change from unsigned int to int. | |
6 | + | |
7 | + * include/wspiapi.h (__wspiapi_getnameinfo): In comparison... | |
8 | + [len < sizeof(struct sockaddr)]: ...cast RHS to socklen_t, which is | |
9 | + the type of len, to ensure type consistency. | |
10 | + | |
1 | 11 | 2020-06-03 Keith Marshall <keith@users.osdn.me> |
2 | 12 | |
3 | 13 | Prepare and publish MinGW.org WSL-5.3.3 release. |
@@ -396,7 +396,7 @@ extern const struct in6_addr in6addr_loopback; | ||
396 | 396 | ) == 0 \ |
397 | 397 | ) |
398 | 398 | |
399 | -typedef unsigned int socklen_t; | |
399 | +typedef int socklen_t; | |
400 | 400 | |
401 | 401 | typedef |
402 | 402 | struct ipv6_mreq |
@@ -914,7 +914,7 @@ WSAAPI int __wspiapi_getnameinfo | ||
914 | 914 | * Microsoft's invalid parameter handler, while reporting it as an |
915 | 915 | * EAI_SYSTEM exception. |
916 | 916 | */ |
917 | - if( (sa == NULL) || (len < sizeof( struct sockaddr )) ) | |
917 | + if( (sa == NULL) || (len < (socklen_t)(sizeof( struct sockaddr ))) ) | |
918 | 918 | return __wspiapi_syserrout( EINVAL ); |
919 | 919 | |
920 | 920 | { /* When the "sa" argument is valid, we delegate the call to the |