struct format *fmt;
register char **ap;
int char_read = 0, format_len, mask;
- char name[NAMESZ], *scanl, *cp;
+ char name[NAMESZ], *cp;
+ charstring_t scanl;
static int dat[5]; /* aux. data for format routine */
m_getfld_state_t gstate = 0;
struct fmt_callbacks cb;
}
}
i = format_len + char_read + 256;
- scanl = mh_xmalloc ((size_t) i + 2);
+ scanl = charstring_create (i + 2);
dat[0] = 0;
dat[1] = 0;
dat[2] = 0;
memset(&cb, 0, sizeof(cb));
cb.formataddr = replformataddr;
cb.concataddr = replconcataddr;
- fmt_scan (fmt, scanl, i + 1, i, dat, &cb);
- fputs (scanl, out);
+ fmt_scan (fmt, scanl, i, dat, &cb);
+ fputs (charstring_buffer (scanl), out);
if (badaddrs) {
fputs ("\nrepl: bad addresses:\n", out);
fputs ( badaddrs, out);
fclose (out);
/* return dynamically allocated buffers */
- free (scanl);
+ charstring_free (scanl);
fmt_free(fmt, 1);
}
/* concatenate all the new addresses onto 'buf' */
for (isgroup = 0; (cp = getname (fixed_str)); ) {
- if ((mp = getm (cp, dfhost, dftype, AD_NAME, error)) == NULL) {
+ if ((mp = getm (cp, dfhost, dftype, error, sizeof(error))) == NULL) {
snprintf (baddr, sizeof(baddr), "\t%s -- %s\n", cp, error);
badaddrs = add (baddr, badaddrs);
continue;
execvp (mhl, arglist);
errstr = strerror(errno);
- write(2, "unable to exec ", 15);
- write(2, mhlproc, strlen(mhlproc));
- write(2, ": ", 2);
- write(2, errstr, strlen(errstr));
- write(2, "\n", 1);
+ if (write(2, "unable to exec ", 15) < 0 ||
+ write(2, mhlproc, strlen(mhlproc)) < 0 ||
+ write(2, ": ", 2) < 0 ||
+ write(2, errstr, strlen(errstr)) < 0 ||
+ write(2, "\n", 1) < 0) {
+ advise ("stderr", "write");
+ }
_exit (-1);
default:
adr_nodep->next = NULL;
/* With AD_NAME, errors are not reported to user. */
- if ((mp = getm (cp, dfhost, dftype, AD_NAME, error)) == NULL) {
+ if ((mp = getm (cp, dfhost, dftype, error,
+ sizeof(error))) == NULL) {
const char *no_at_sign = "no at-sign after local-part";
adr_nodep->escape_local_part =
new_adr = concat (display_name, " ", angle_addr, NULL);
adr = getname (new_adr);
if (adr != NULL &&
- (mp = getm (adr, dfhost, dftype, AD_NAME, NULL)) != NULL) {
+ (mp = getm (adr, dfhost, dftype, NULL, 0)) != NULL) {
fixed_address = 1;
mnfree (mp);
}