]> code.delx.au - gnu-emacs/blobdiff - lib-src/pop.c
(fullwrite): Get rid of an extra call to write. Problem
[gnu-emacs] / 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;