[Lldb-commits] [lldb] r226301 - Compile fix for WIN32

Vince Harron vharron at google.com
Fri Jan 16 11:07:30 PST 2015


Author: vharron
Date: Fri Jan 16 13:07:30 2015
New Revision: 226301

URL: http://llvm.org/viewvc/llvm-project?rev=226301&view=rev
Log:
Compile fix for WIN32


Modified:
    lldb/trunk/source/Host/common/SocketAddress.cpp

Modified: lldb/trunk/source/Host/common/SocketAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/SocketAddress.cpp?rev=226301&r1=226300&r2=226301&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/SocketAddress.cpp (original)
+++ lldb/trunk/source/Host/common/SocketAddress.cpp Fri Jan 16 13:07:30 2015
@@ -41,11 +41,13 @@ const char* inet_ntop(int af, const void
     {
         case AF_INET:
         {
-            const char* formatted = inet_ntoa(*static_cast<const in_addr*>(src));
-            if (formatted && strlen(formatted) < size)
             {
-                strncpy(dst, formatted, size);
-                return dst;
+                const char* formatted = inet_ntoa(*static_cast<const in_addr*>(src));
+                if (formatted && strlen(formatted) < size)
+                {
+                    strncpy(dst, formatted, size);
+                    return dst;
+                }
             }
             return nullptr;
         case AF_INET6:
@@ -57,7 +59,7 @@ const char* inet_ntop(int af, const void
                                           ntohs(src16[0]), ntohs(src16[1]), ntohs(src16[2]), ntohs(src16[3]),
                                           ntohs(src16[4]), ntohs(src16[5]), ntohs(src16[6]), ntohs(src16[7])
                                           );
-                if (full_size < size)
+                if (full_size < static_cast<int>(size))
                 {
                     strncpy(dst,tmp,size);
                     return dst;
@@ -65,9 +67,9 @@ const char* inet_ntop(int af, const void
                 return nullptr;
             }
         }
-        return nullptr;
     }
-    
+    return nullptr;
+} 
 #endif
     
 





More information about the lldb-commits mailing list