From: Ken Hornstein Date: Mon, 19 Nov 2012 20:29:01 +0000 (-0500) Subject: Make sure we strip off a newline from components we want to display (we X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;ds=inline;h=c616181932ec412f09430dba5a90dbf37ef79ba8;hp=-c;p=mmh Make sure we strip off a newline from components we want to display (we were stripping off a newline from the wrong copy of the component). --- c616181932ec412f09430dba5a90dbf37ef79ba8 diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 2d101d1..45d99b0 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -1168,7 +1168,7 @@ mcomp_format (struct mcomp *c1, struct mcomp *c2) if (!(c1->c_flags & ADDRFMT)) { if (c1->c_c_text) - c1->c_c_text->c_text = getcpy (ap); + c1->c_c_text->c_text = ap; if ((cp = strrchr(ap, '\n'))) /* drop ending newline */ if (!cp[1]) *cp = 0; @@ -1177,7 +1177,7 @@ mcomp_format (struct mcomp *c1, struct mcomp *c2) /* Don't need to append a newline, dctime() already did */ c2->c_text = getcpy (buffer); - free (ap); + /* ap is now owned by the component struct, so do NOT free it here */ return; }