(fullwrite): Get rid of an extra call to write. Problem

pointed out by Chiaki Ishikawa.
This commit is contained in:
Karl Heuer 1997-10-31 23:09:43 +00:00
parent 2ed2806cd9
commit 9d3f4cee9d

View file

@ -1410,10 +1410,10 @@ fullwrite (fd, buf, nbytes)
int nbytes;
{
char *cp;
int ret;
int ret = 0;
cp = buf;
while ((ret = SEND (fd, cp, nbytes, 0)) > 0)
while (nbytes && ((ret = SEND (fd, cp, nbytes, 0)) > 0))
{
cp += ret;
nbytes -= ret;