void rfc822_qualify(address_t *addr, const char *host)
{
- char *p;
+ if (!host)
+ return;
for (; addr; addr = addr->next) {
if (!addr->group && addr->mailbox && !strchr(addr->mailbox, '@')) {
- p = p_new(char, m_strlen(addr->mailbox) + m_strlen(host) + 2);
+ char *p = p_new(char, m_strlen(addr->mailbox) + m_strlen(host) + 2);
sprintf(p, "%s@%s", addr->mailbox, host);
p_delete(&addr->mailbox);
addr->mailbox = p;
}
if (addr->personal) {
- pos += m_strcpy(buf + pos, buflen - pos, ">");
+ pos += m_strputc(buf + pos, buflen - pos, '>');
}
if (addr->group) {
- pos += m_strcpy(buf + pos, buflen - pos, ":");
+ pos += m_strputc(buf + pos, buflen - pos, ':');
}
} else {
- pos += m_strcpy(buf + pos, buflen - pos, ";");
+ pos += m_strputc(buf + pos, buflen - pos, ';');
}
return pos;