OSDN Git Service

Revert typedef of socklen_t to signed int type.
authorKeith Marshall <keith@users.osdn.me>
Sun, 5 Jul 2020 21:32:09 +0000 (22:32 +0100)
committerKeith Marshall <keith@users.osdn.me>
Sun, 5 Jul 2020 21:32:09 +0000 (22:32 +0100)
w32api/ChangeLog
w32api/include/ws2tcpip.h
w32api/include/wspiapi.h

index 9a82007..b13fafd 100644 (file)
@@ -1,3 +1,13 @@
+2020-07-05  Keith Marshall  <keith@users.osdn.me>
+
+       Revert typedef of socklen_t to signed int type.
+
+       * include/ws2tcpip.h (socklen_t): Change from unsigned int to int.
+
+       * include/wspiapi.h (__wspiapi_getnameinfo): In comparison...
+       [len < sizeof(struct sockaddr)]: ...cast RHS to socklen_t, which is
+       the type of len, to ensure type consistency.
+
 2020-06-03  Keith Marshall  <keith@users.osdn.me>
 
        Prepare and publish MinGW.org WSL-5.3.3 release.
index da9a306..dc408cd 100644 (file)
@@ -396,7 +396,7 @@ extern const struct in6_addr in6addr_loopback;
         ) == 0                                                 \
  )
 
-typedef unsigned int socklen_t;
+typedef int socklen_t;
 
 typedef
 struct ipv6_mreq
index 0dc7656..1f1b647 100644 (file)
@@ -914,7 +914,7 @@ WSAAPI int __wspiapi_getnameinfo
    * Microsoft's invalid parameter handler, while reporting it as an
    * EAI_SYSTEM exception.
    */
-  if( (sa == NULL) || (len < sizeof( struct sockaddr )) )
+  if( (sa == NULL) || (len < (socklen_t)(sizeof( struct sockaddr ))) )
     return __wspiapi_syserrout( EINVAL );
 
   { /* When the "sa" argument is valid, we delegate the call to the