]> git.mxchange.org Git - flightgear.git/commitdiff
Tweak with readline() return value.
authorcurt <curt>
Mon, 22 Nov 1999 18:08:14 +0000 (18:08 +0000)
committercurt <curt>
Mon, 22 Nov 1999 18:08:14 +0000 (18:08 +0000)
src/Network/garmin.cxx
src/Network/nmea.cxx

index 6a0814b72c0124549e6bae27dc7199c3b899d911..40238c1adea39109962175dedf72b0e34c786d45 100644 (file)
@@ -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." );
index 7eeb98827281cd75430e6445059a095b5b0750cf..d32d6953de844a283617065b8c19cd244f1f87d5 100644 (file)
@@ -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." );