From f48600e213adcb4786940248e73a91293fb04513 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 13 Dec 2012 14:45:53 +0000 Subject: [PATCH] small fix --- Common/GmshSocket.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/GmshSocket.h b/Common/GmshSocket.h index aa8d39b264..71b848b089 100644 --- a/Common/GmshSocket.h +++ b/Common/GmshSocket.h @@ -198,7 +198,7 @@ class GmshSocket{ int ReceiveHeader(int *type, int *len, int *swap) { *swap = 0; - if(_ReceiveData(type, sizeof(int))){ + if(_ReceiveData(type, sizeof(int)) > 0){ if(*type < 0) return 0; if(*type > 65535){ // the data comes from a machine with different endianness and @@ -206,7 +206,7 @@ class GmshSocket{ *swap = 1; _SwapBytes((char*)type, sizeof(int), 1); } - if(_ReceiveData(len, sizeof(int))){ + if(_ReceiveData(len, sizeof(int)) > 0){ if(*len < 0) return 0; if(*swap) _SwapBytes((char*)len, sizeof(int), 1); return 1; -- GitLab