* fhandler.cc (fhandler_base::puts_readahead): Change

while condition to disallow wild runs.
This commit is contained in:
Corinna Vinschen 2000-05-09 21:55:11 +00:00
parent f26e3f1574
commit 7a87f0326b
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Thu May 9 23:53:00 2000 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::puts_readahead): Change
while condition to disallow wild runs.
Thu May 9 15:24:00 2000 Corinna Vinschen <corinna@vinschen.de>
Patch suggested by <lha@stacken.kth.se>

View File

@ -22,8 +22,8 @@ int
fhandler_base::puts_readahead (const char *s, size_t len = (size_t) -1)
{
int success = 1;
while ((((len == (size_t) -1) && *s) || len--) &&
(success = put_readahead (*s++) > 0))
while ((*s || (len != (size_t) -1 && len--))
&& (success = put_readahead (*s++) > 0))
continue;
return success;
}