Thomas Faber : ws2_32: Avoid a variable-length array.

Alexandre Julliard julliard at winehq.org
Tue Mar 25 14:27:43 CDT 2014


Module: wine
Branch: master
Commit: 626040b1acce87e40e0aa2f190bc020b9e2632fc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=626040b1acce87e40e0aa2f190bc020b9e2632fc

Author: Thomas Faber <thomas.faber at reactos.org>
Date:   Tue Mar 25 16:49:12 2014 +0100

ws2_32: Avoid a variable-length array.

---

 dlls/ws2_32/socket.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 42044e6..cdcbb11 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -3337,12 +3337,13 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
 #endif
 
 #ifdef HAS_IRDA
+#define MAX_IRDA_DEVICES 10
+
     case WS_SOL_IRLMP:
         switch(optname)
         {
         case WS_IRLMP_ENUMDEVICES:
         {
-            static const int MAX_IRDA_DEVICES = 10;
             char buf[sizeof(struct irda_device_list) +
                      (MAX_IRDA_DEVICES - 1) * sizeof(struct irda_device_info)];
             int res;
@@ -3402,6 +3403,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
             return SOCKET_ERROR;
         }
         break; /* case WS_SOL_IRLMP */
+#undef MAX_IRDA_DEVICES
 #endif
 
     /* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */




More information about the wine-cvs mailing list