Tweak with readline() return value.
This commit is contained in:
parent
57163baca0
commit
8c789b1e61
2 changed files with 4 additions and 4 deletions
|
@ -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." );
|
||||
|
|
|
@ -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." );
|
||||
|
|
Loading…
Reference in a new issue