rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | LICENSE

commit 8609a6a20e2133067c19e86b3222eac0a0ff9153
parent 808ce93bcad7e1555229692d66f77010a60412a5
Author: Christoph Lohmann <20h@r-36.net>
Date:   Tue, 14 May 2013 18:09:09 +0200

Adding whitespace like in RFC 822.

Diffstat:
ind.c | 4++++
mime.c | 8++++++++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/ind.c b/ind.c @@ -85,6 +85,10 @@ memdupz(void *p, int l) return (void *)ret; } +/* + * Append the data at c with the length of lc to + * p, at position lp of p. + */ void * memdupcat(void *p, int lp, void *c, int lc) { diff --git a/mime.c b/mime.c @@ -851,6 +851,14 @@ mime_parsebufintern(mime_t *mime, char *str, int len) if (value != NULL && hdr != NULL) { if (hdr->data != NULL) { part = memdup(value, strlen(value)+1); + + /* Adding a space. */ + hdr->data = memdupcat(hdr->data, + hdr->datalen-1, + " ", 1); + hdr->datalen++; + + /* Adding the next line. */ i = strlen(part); key = memdupcat(hdr->data, hdr->datalen-1,