X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Ffmt_addr.c;h=be9b48390b02bf9abb51a772d2ee63acbc547f6d;hb=5dd6771b28c257af405d7248639ed0e3bcdce38b;hp=2e4bff61ea835bee5cbd0133e17ef6c9bed37cd8;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/sbr/fmt_addr.c b/sbr/fmt_addr.c index 2e4bff6..be9b483 100644 --- a/sbr/fmt_addr.c +++ b/sbr/fmt_addr.c @@ -2,8 +2,6 @@ /* * fmt_addr.c -- format an address field (from fmt_scan) * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -12,6 +10,7 @@ #include #include #include +#include static char *buf; /* our current working buffer */ static char *bufend; /* end of working buffer */ @@ -28,11 +27,9 @@ static unsigned int bufsiz; /* 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;\ } @@ -63,9 +60,7 @@ formataddr (char *orig, char *str) /* if we don't have a buffer yet, get one */ if (bufsiz == 0) { - buf = malloc (BUFINCR); - if (! buf) - adios (NULL, "formataddr: couldn't allocate buffer space"); + buf = mh_xmalloc (BUFINCR); last_dst = buf; /* XXX */ bufsiz = BUFINCR - 6; /* leave some slop */ bufend = buf + bufsiz;