diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9a2750b86..5554eab6c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2004-12-12 Bas van Gompel + + * fhandler.cc (fhandler_base::puts_readahead): Fix end-condition. + 2004-12-10 Corinna Vinschen * errno.cc (errmap): Map ERROR_INVALID_ADDRESS to EINVAL instead of diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 3e7cee312..ebe3d7175 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -54,7 +54,7 @@ int fhandler_base::puts_readahead (const char *s, size_t len) { int success = 1; - while ((*s || (len != (size_t) -1 && len--)) + while ((len == (size_t) -1 ? *s : len--) && (success = put_readahead (*s++) > 0)) continue; return success;