projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
If post or send fail, exit with their exit status.
[mmh]
/
sbr
/
fmt_addr.c
diff --git
a/sbr/fmt_addr.c
b/sbr/fmt_addr.c
index
150aa73
..
3186dea
100644
(file)
--- a/
sbr/fmt_addr.c
+++ b/
sbr/fmt_addr.c
@@
-2,12
+2,15
@@
/*
* fmt_addr.c -- format an address field (from fmt_scan)
*
/*
* 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.
*/
#include <h/mh.h>
#include <h/addrsbr.h>
#include <h/fmt_scan.h>
*/
#include <h/mh.h>
#include <h/addrsbr.h>
#include <h/fmt_scan.h>
+#include <h/utils.h>
static char *buf; /* our current working buffer */
static char *bufend; /* end of working buffer */
static char *buf; /* our current working buffer */
static char *bufend; /* end of working buffer */
@@
-24,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;\
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;\
dst = buf + i;\
last_dst = buf + n;\
- if (! buf)\
- adios (NULL, "formataddr: couldn't get buffer space");\
bufend = buf + bufsiz;\
}
bufend = buf + bufsiz;\
}
@@
-59,9
+60,7
@@
formataddr (char *orig, char *str)
/* if we don't have a buffer yet, get one */
if (bufsiz == 0) {
/* 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;
last_dst = buf; /* XXX */
bufsiz = BUFINCR - 6; /* leave some slop */
bufend = buf + bufsiz;
@@
-113,3
+112,8
@@
formataddr (char *orig, char *str)
last_dst = dst;
return (buf);
}
last_dst = dst;
return (buf);
}
+
+char *concataddr (char *orig, char *str)
+{
+ return formataddr(orig, str);
+}