return (ferror (sm_wfp) ? sm_werror () : OK);
}
- for (bp = buffer; len > 0; bp++, len--) {
+ for (bp = buffer; bp && len > 0; bp++, len--) {
switch (*bp) {
case '\n':
sm_nl = TRUE;
}
} else
#endif /* TLS_SUPPORT */
- fwrite(buffer, sizeof(*buffer), len, sm_wfp);
+ if ((int) fwrite(buffer, sizeof(*buffer), len, sm_wfp) < len) {
+ advise ("sm_fwrite", "fwrite");
+ }
#ifdef CYRUS_SASL
} else {
while (len >= maxoutbuf - sasl_outbuflen) {
return NOTOK;
}
- fwrite(output, sizeof(*output), outputlen, sm_wfp);
+ if (fwrite(output, sizeof(*output), outputlen, sm_wfp) <
+ outputlen) {
+ advise ("sm_fwrite", "fwrite");
+ }
}
if (len > 0) {
return;
}
- fwrite(output, sizeof(*output), outputlen, sm_wfp);
+ if (fwrite(output, sizeof(*output), outputlen, sm_wfp) < outputlen) {
+ advise ("sm_fflush", "fwrite");
+ }
sasl_outbuflen = 0;
}
#endif /* CYRUS_SASL */
int i, code, cont, bc = 0, rc, more;
unsigned char *bp;
char *rp;
- char **ehlo = NULL, buffer[BUFSIZ];
+ char **ehlo = EHLOkeys, buffer[BUFSIZ];
if (doingEHLO) {
static int at_least_once = 0;