X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2..94187a80bd60baab4b9c4b949ad820d730578123:/sbr/fmt_addr.c diff --git a/sbr/fmt_addr.c b/sbr/fmt_addr.c index 97f4271e..2c7b58e4 100644 --- a/sbr/fmt_addr.c +++ b/sbr/fmt_addr.c @@ -1,8 +1,4 @@ - -/* - * fmt_addr.c -- format an address field (from fmt_scan) - * - * $Id$ +/* fmt_addr.c -- format an address field (from fmt_scan) * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for @@ -29,11 +25,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;\ } @@ -55,12 +49,12 @@ static unsigned int bufsiz; /* current size of buf */ char * formataddr (char *orig, char *str) { - register int len; - register int isgroup; - register char *dst; - register char *cp; - register char *sp; - register struct mailname *mp = NULL; + int len; + int isgroup; + char *dst; + char *cp; + char *sp; + struct mailname *mp = NULL; /* if we don't have a buffer yet, get one */ if (bufsiz == 0) { @@ -86,7 +80,7 @@ formataddr (char *orig, char *str) /* concatenate all the new addresses onto 'buf' */ for (isgroup = 0; (cp = getname (str)); ) { - if ((mp = getm (cp, NULL, 0, fmt_norm, NULL)) == NULL) + if ((mp = getm (cp, NULL, 0, NULL, 0)) == NULL) continue; if (isgroup && (mp->m_gname || !mp->m_ingrp)) { @@ -114,5 +108,10 @@ formataddr (char *orig, char *str) *dst = '\0'; last_dst = dst; - return (buf); + return buf; +} + +char *concataddr (char *orig, char *str) +{ + return formataddr(orig, str); }