X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/275cd091960ac836c4ccb3b7e07ceeda6df7ddd7..8eacff500716cab8256b032c0f4dd29bc2dc16bb:/uip/fmttest.c diff --git a/uip/fmttest.c b/uip/fmttest.c index 712d7df2..8c850197 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -351,10 +351,10 @@ main (int argc, char **argv) if (trace) { struct trace_context *ctx; - ctx = mh_xmalloc(sizeof(*ctx)); + NEW(ctx); ctx->num = -1; ctx->str = dummy; - ctx->outbuf = getcpy(NULL); + ctx->outbuf = mh_xstrdup(""); cb.trace_func = test_trace; cb.trace_context = ctx; @@ -420,11 +420,10 @@ process_addresses(struct format *fmt, struct msgs_array *addrs, for (i = 0; i < addrs->size; i++) { (q = &pq)->pq_next = NULL; while ((cp = getname(addrs->msgs[i]))) { - if ((p = (struct pqpair *) mh_xcalloc ((size_t) 1, sizeof(*p))) == NULL) - adios (NULL, "unable to allocate pqpair memory"); + NEW0(p); if ((mp = getm(cp, NULL, 0, error, sizeof(error))) == NULL) { - p->pq_text = getcpy(cp); - p->pq_error = getcpy(error); + p->pq_text = mh_xstrdup(cp); + p->pq_error = mh_xstrdup(error); } else { p->pq_text = getcpy(mp->m_text); mnfree(mp); @@ -530,7 +529,7 @@ process_messages(struct format *fmt, struct msgs_array *comps, if ((cp = context_find(usequence)) && *cp) { char **ap, *dp; - dp = getcpy(cp); + dp = mh_xstrdup(cp); ap = brkstring(dp, " ", "\n"); for (i = 0; ap && *ap; i++, ap++) ivector_push_back (seqnum, seq_getnum(mp, *ap)); @@ -756,7 +755,7 @@ test_trace(void *context, struct format *fmt, int num, char *str, litputs(outbuf); putchar('\n'); free(ctx->outbuf); - ctx->outbuf = getcpy(outbuf); + ctx->outbuf = mh_xstrdup(outbuf); } } @@ -778,7 +777,7 @@ fmt_dump (char *nfs, struct format *fmth) static void dumpone(struct format *fmt) { - register int i; + int i; if ((i = findlabel(fmt)) >= 0) printf("L%d:", i); @@ -990,7 +989,7 @@ initlabels(struct format *fmth) static int findlabel(struct format *addr) { - register int i; + int i; for (i = 0; i < lused; ++i) if (addr == lvec[i]) @@ -1224,13 +1223,13 @@ static unsigned int bufsiz=0; /* current size of buf */ static char * test_formataddr (char *orig, char *str) { - register int len; + int len; char error[BUFSIZ]; - register int isgroup; - register char *dst; - register char *cp; - register char *sp; - register struct mailname *mp = NULL; + 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) {