1
0
Fork 0

Tweak with readline() return value.

This commit is contained in:
curt 1999-11-22 18:08:14 +00:00
parent 57163baca0
commit 8c789b1e61
2 changed files with 4 additions and 4 deletions

View 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." );

View 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." );