X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/d79618303ff42aa5e0bc2dba51fdd7b385bc97d4..23816efd3e8e294e8f1c1ce811ac3a1cd15d334e:/sbr/addrsbr.c diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index 62abfb99..af8ecd4d 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -6,6 +6,9 @@ */ #include "h/mh.h" +#include "snprintb.h" +#include "strindex.h" +#include "uprf.h" #include "getcpy.h" #include "context_find.h" #include "error.h" @@ -223,17 +226,17 @@ mnfree (struct mailname *mp) char * auxformat (struct mailname *mp, int extras) { - static char addr[BUFSIZ]; + static char addr[BUFSIZ-4]; static char buffer[BUFSIZ]; if (mp->m_nohost) strncpy (addr, FENDNULL(mp->m_mbox), sizeof(addr)); else if (mp->m_type != UUCPHOST) { if (mp->m_host) - snprintf (addr, sizeof(addr), "%s%s@%s", FENDNULL(mp->m_path), + snprintf (addr, sizeof(addr), "%s%s@%s", FENDNULL(mp->m_path), FENDNULL(mp->m_mbox), mp->m_host); else snprintf (addr, sizeof(addr), "%s%s", FENDNULL(mp->m_path), - FENDNULL(mp->m_mbox)); + FENDNULL(mp->m_mbox)); } else snprintf (addr, sizeof(addr), "%s!%s", mp->m_host, mp->m_mbox); @@ -290,7 +293,7 @@ ismymbox (struct mailname *np) */ if (am == NULL) { mq.m_next = NULL; - mq.m_mbox = getusername (); + mq.m_mbox = getusername (0); if ((am = context_find ("local-mailbox"))) { @@ -309,11 +312,11 @@ ismymbox (struct mailname *np) /* Sigh, it turns out that the address parser gets messed up * if you don't call getname() until it returns NULL. */ while (getname(am) != NULL) - ; + ; } if ((am = context_find ("alternate-mailboxes")) == NULL) - am = getusername(); + am = getusername(0); else { mp = mq.m_next ? mq.m_next : &mq; oops = false;