From: Karl Heuer Date: Fri, 31 Oct 1997 23:09:43 +0000 (+0000) Subject: (fullwrite): Get rid of an extra call to write. Problem X-Git-Tag: emacs-20.3~2869 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9d3f4cee9dda340e31efb6b4a4d880dec46b00c7;p=emacs.git (fullwrite): Get rid of an extra call to write. Problem pointed out by Chiaki Ishikawa. --- diff --git a/lib-src/pop.c b/lib-src/pop.c index d1b39927738..16823baa1d4 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c @@ -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;