From 8c789b1e612a0f7d17071f84b3ab739cb5696913 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 22 Nov 1999 18:08:14 +0000 Subject: [PATCH] Tweak with readline() return value. --- src/Network/garmin.cxx | 4 ++-- src/Network/nmea.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Network/garmin.cxx b/src/Network/garmin.cxx index 6a0814b72..40238c1ad 100644 --- a/src/Network/garmin.cxx +++ b/src/Network/garmin.cxx @@ -373,7 +373,7 @@ bool FGGarmin::process() { return false; } } else if ( get_direction() == in ) { - if ( length = io->readline( buf, FG_MAX_MSG_SIZE ) ) { + if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { FG_LOG( FG_IO, FG_ALERT, "Success reading data." ); if ( parse_message() ) { FG_LOG( FG_IO, FG_ALERT, "Success parsing data." ); @@ -384,7 +384,7 @@ bool FGGarmin::process() { FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); return false; } - if ( length = io->readline( buf, FG_MAX_MSG_SIZE ) ) { + if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { FG_LOG( FG_IO, FG_ALERT, "Success reading data." ); if ( parse_message() ) { FG_LOG( FG_IO, FG_ALERT, "Success parsing data." ); diff --git a/src/Network/nmea.cxx b/src/Network/nmea.cxx index 7eeb98827..d32d6953d 100644 --- a/src/Network/nmea.cxx +++ b/src/Network/nmea.cxx @@ -476,13 +476,13 @@ bool FGNMEA::process() { return false; } } else if ( get_direction() == in ) { - if ( length = io->readline( buf, FG_MAX_MSG_SIZE ) ) { + if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { parse_message(); } else { FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); return false; } - if ( length = io->readline( buf, FG_MAX_MSG_SIZE ) ) { + if ( (length = io->readline( buf, FG_MAX_MSG_SIZE )) > 0 ) { parse_message(); } else { FG_LOG( FG_IO, FG_ALERT, "Error reading data." ); -- 2.39.5