Skip to content
Snippets Groups Projects
Commit f48600e2 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

small fix

parent 8369a5d9
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment