From 95412237f59e8b794c8933df66136596d659a0ed Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 25 Aug 2013 08:10:06 +0000
Subject: [PATCH] don't test size/length < 0

---
 Common/GmshSocket.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Common/GmshSocket.h b/Common/GmshSocket.h
index c8933c1e9b..19cddb8e55 100644
--- a/Common/GmshSocket.h
+++ b/Common/GmshSocket.h
@@ -205,7 +205,6 @@ class GmshSocket{
   {
     *swap = 0;
     if(_ReceiveData(type, sizeof(int)) > 0){
-      if(*type < 0) return 0;
       if(*type > 65535){
         // the data comes from a machine with different endianness and
         // we must swap the bytes
@@ -213,7 +212,6 @@ class GmshSocket{
         _SwapBytes((char*)type, sizeof(int), 1);
       }
       if(_ReceiveData(len, sizeof(int)) > 0){
-        if(*len < 0) return 0;
         if(*swap) _SwapBytes((char*)len, sizeof(int), 1);
         return 1;
       }
@@ -372,7 +370,7 @@ class GmshServer : public GmshSocket{
 #if !defined(WIN32) || defined(__CYGWIN__)
       if(tmpsock < 0)
 #else
-	if(tmpsock == (int)INVALID_SOCKET)
+      if(tmpsock == (int)INVALID_SOCKET)
 #endif
         throw "Couldn't create socket";
       // bind the socket to its name
-- 
GitLab