]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/sg_file.cxx
Cygwin fixes.
[simgear.git] / simgear / io / sg_file.cxx
index 079fefec7283dd90c54c12d991605ad7a915f050..0caf3f4a44357152ecdcc75ec275eef32f91c0c7 100644 (file)
@@ -80,7 +80,7 @@ bool SGFile::open( const SGProtocolDir d ) {
 int SGFile::read( char *buf, int length ) {
     // read a chunk
     ssize_t result = ::read( fp, buf, length );
-    if ( result == 0 ) {
+    if ( length > 0 && result == 0 ) {
         eof_flag = true;
     }
     return result;
@@ -94,7 +94,7 @@ int SGFile::readline( char *buf, int length ) {
 
     // read a chunk
     ssize_t result = ::read( fp, buf, length );
-    if ( result == 0 ) {
+    if ( length > 0 && result == 0 ) {
         eof_flag = true;
     }