X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/370eb511c48f5d0a2e28336835e9929e6215abb1..23816efd3e8e294e8f1c1ce811ac3a1cd15d334e:/sbr/addrsbr.c diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index eadf1d07..af8ecd4d 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -5,11 +5,17 @@ * complete copyright information. */ -#include -#include -#include -#include -#include +#include "h/mh.h" +#include "snprintb.h" +#include "strindex.h" +#include "uprf.h" +#include "getcpy.h" +#include "context_find.h" +#include "error.h" +#include "h/addrsbr.h" +#include "h/mf.h" +#include "h/mts.h" +#include "h/utils.h" /* High level parsing of addresses: @@ -77,7 +83,8 @@ static char adr[BUFSIZ]; static int eai = 0; void -enable_eai(void) { +enable_eai(void) +{ eai = 1; } @@ -219,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); @@ -270,7 +277,7 @@ auxformat (struct mailname *mp, int extras) bool ismymbox (struct mailname *np) { - int oops; + bool oops; int len, i; char *cp; char *pp; @@ -278,7 +285,7 @@ ismymbox (struct mailname *np) struct mailname *mp; static char *am = NULL; static struct mailname mq; - static int localmailbox = 0; + static bool localmailbox; /* * If this is the first call, initialize @@ -286,11 +293,11 @@ 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"))) { - localmailbox++; + localmailbox = true; if ((cp = getname(am)) == NULL) { inform("Unable to find address in local-mailbox, continuing..."); @@ -305,18 +312,18 @@ 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 = 0; + oops = false; while ((cp = getname (am))) { if ((mp->m_next = getm (cp, NULL, 0, NULL, 0)) == NULL) { inform("illegal address: %s, continuing...", cp); - oops++; + oops = true; } else { mp = mp->m_next; mp->m_type = W_NIL;