X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Freplsbr.c;h=b8e8e9261e3b249549ceded51ffcff2c64784808;hp=d92fade2c07358337f402b30f1c4047698250b70;hb=255d4c646c0d7aa6b049052fef47fa083b1b1506;hpb=81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2 diff --git a/uip/replsbr.c b/uip/replsbr.c index d92fade..b8e8e92 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -162,7 +162,9 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, if (!strcasecmp(name, cptr->c_name)) { char_read += msg_count; if (! cptr->c_text) { - cptr->c_text = tmpbuf; + i = strlen(cptr->c_text = tmpbuf) - 1; + if (tmpbuf[i] == '\n') + tmpbuf[i] = '\0'; *--savecomp = cptr; tmpbuf = *nxtbuf++; } else { @@ -291,11 +293,9 @@ static unsigned int bufsiz=0; /* current size of buf */ int i = dst - buf;\ int n = last_dst - buf;\ bufsiz += ((dst + len - bufend) / BUFINCR + 1) * BUFINCR;\ - buf = realloc (buf, bufsiz);\ + buf = mh_xrealloc (buf, bufsiz);\ dst = buf + i;\ last_dst = buf + n;\ - if (! buf)\ - adios (NULL, "formataddr: couldn't get buffer space");\ bufend = buf + bufsiz;\ }