X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/337b4e616e8f53ba06285b1645e1df9918ed5c16..9288f7d18d7b05795f4bcf4e1a03c13adc1496c0:/mts/smtp/smtp.c?ds=inline diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 58ca023c..8b89dec3 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -96,7 +96,7 @@ static FILE *sm_wfp = NULL; */ static sasl_conn_t *conn = NULL; /* SASL connection state */ -static int sasl_complete = 0; /* Has authentication succeded? */ +static int sasl_complete = 0; /* Has authentication succeeded? */ static sasl_ssf_t sasl_ssf; /* Our security strength factor */ static int maxoutbuf; /* Maximum crypto output buffer */ static char *sasl_outbuffer; /* SASL output buffer for encryption */ @@ -1272,7 +1272,9 @@ sm_fwrite(char *buffer, int len) } } 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) { @@ -1288,7 +1290,10 @@ sm_fwrite(char *buffer, int len) 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) { @@ -1397,7 +1402,7 @@ tls_negotiate(void) #endif /* TLS_SUPPORT */ /* - * Convenience functions to replace occurences of fputs() and fputc() + * Convenience functions to replace occurrences of fputs() and fputc() */ static int @@ -1435,7 +1440,9 @@ sm_fflush(void) 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 */