X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-mime%2Frfc822address.c;h=a6a06c432319898f3bacfcb66d957e0a01afae34;hb=c76ab67f3430e67b14b381bc1e3a23a14a4053b8;hp=ad4e117c46fa9fe2994a582146666039a448ea11;hpb=fc854762626c5e2dce8c5618860a882934ec81d2;p=apps%2Fmadmutt.git diff --git a/lib-mime/rfc822address.c b/lib-mime/rfc822address.c index ad4e117..a6a06c4 100644 --- a/lib-mime/rfc822address.c +++ b/lib-mime/rfc822address.c @@ -32,11 +32,12 @@ 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; @@ -409,14 +410,14 @@ ssize_t rfc822_write_address_single(char *buf, ssize_t buflen, } 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;