]> git.eshelyaron.com Git - emacs.git/commitdiff
(fullwrite): Get rid of an extra call to write. Problem
authorKarl Heuer <kwzh@gnu.org>
Fri, 31 Oct 1997 23:09:43 +0000 (23:09 +0000)
committerKarl Heuer <kwzh@gnu.org>
Fri, 31 Oct 1997 23:09:43 +0000 (23:09 +0000)
pointed out by Chiaki Ishikawa.

lib-src/pop.c

index d1b3992773872d33ac4dd0931ac0d9ed682a48a1..16823baa1d47dd89b95305860c72bec71e20db78 100644 (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;