X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mutt_libesmtp.c;h=82e1a5f35602d5969fd12355b6715ecb4f0a0e2a;hp=9df7ffbdf625a76b44299679566e519d98338758;hb=8fdb4b6b3ef01527b99bdcb1c0542cb2abf1056a;hpb=f3cbb9f51357972f6e74244494236a41dc4d84cd diff --git a/mutt_libesmtp.c b/mutt_libesmtp.c index 9df7ffb..82e1a5f 100644 --- a/mutt_libesmtp.c +++ b/mutt_libesmtp.c @@ -144,7 +144,7 @@ static const char *_mutt_libesmtp_messagefp_cb (void **buf, int *len, int octets; if (*buf == NULL) - *buf = malloc (BUFLEN); + *buf = xmalloc(BUFLEN); if (len == NULL) { rewind ((FILE *) arg); @@ -158,7 +158,7 @@ static const char *_mutt_libesmtp_messagefp_cb (void **buf, int *len, char *p = strchr (*buf, '\0'); if (p[-1] == '\n' && p[-2] != '\r') { - m_strcpy(p - 1, "\r\n"); + m_strcpy(p - 1, *buf + BUFLEN - p + 1, "\r\n"); p++; } octets = p - (char *) *buf;