From 1e0f42d3b6bda9414fe403746b9de521f0e18c63 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 10 Aug 2015 00:04:25 +0200 Subject: [PATCH] use the return value from read --- src/fterm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fterm.cpp b/src/fterm.cpp index 9daea305..3758d0c7 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -3390,8 +3390,8 @@ FString FTerm::getAnswerbackMsg() fflush(stdout); usleep(150000); // wait 150 ms // read the answerback message - read(fileno(stdin), &temp, sizeof(temp)-1); - answerback = temp; + if ( read(fileno(stdin), &temp, sizeof(temp)-1) > 0 ) + answerback = temp; } return answerback; } @@ -3412,8 +3412,8 @@ FString FTerm::getSecDA() fflush(stdout); usleep(150000); // wait 150 ms // read the answer - read(fileno(stdin), &temp, sizeof(temp)-1); - sec_da = temp; + if ( read(fileno(stdin), &temp, sizeof(temp)-1) > 0 ) + sec_da = temp; } return sec_da; }