]> diplodocus.org Git - nmh/blobdiff - uip/popsbr.c
Merge commit '8206fbf', due to my screwup of committing it on a detached
[nmh] / uip / popsbr.c
index 8334dee6f92e5cadbaf3c58aa6bca04540cf0f00..15d03f0b3b4b1b79015a20d8179775c1fbab4891 100644 (file)
@@ -899,7 +899,7 @@ sasl_getline (char *s, int n, FILE *iop)
     *p = 0;
     if (*--p == '\n')
        *p = 0;
     *p = 0;
     if (*--p == '\n')
        *p = 0;
-    if (*--p == '\r')
+    if (p > s  &&  *--p == '\r')
        *p = 0;
 
     return OK;
        *p = 0;
 
     return OK;
@@ -936,7 +936,9 @@ putline (char *s, FILE *iop)
            return NOTOK;
        }
 
            return NOTOK;
        }
 
-       fwrite(buf, buflen, 1, iop);
+       if (fwrite(buf, buflen, 1, iop) < 1) {
+           advise ("putline", "fwrite");
+       }
     }
 #endif /* CYRUS_SASL */
 
     }
 #endif /* CYRUS_SASL */