void mnfree(struct mailname *);
int ismymbox(struct mailname *);
char *getname(char *);
-char *adrsprintf(char *, char *);
+char *getlocaladdr(void);
char *auxformat(struct mailname *, int);
struct mailname *getm(char *, char *, int, int, char *);
/*
- * address specific "sprintf"
+ * This used to be adrsprintf() (where it would format an address for you
+ * given a username and a domain). But somewhere we got to the point where
+ * the only caller was post, and it only called it with both arguments NULL.
+ * So the function was renamed with a more sensible name.
*/
char *
-adrsprintf (char *username, char *domain)
+getlocaladdr(void)
{
int snprintf_return;
+ char *username, *domain;
static char addr[BUFSIZ];
- if (username == NULL)
- username = getusername();
+ username = getusername();
if (username_extension_masquerading) {
/* mts.conf contains "masquerade:[...]username_extension[...]", so tack
return username;
- if (domain == NULL)
- domain = LocalName();
+ domain = LocalName();
snprintf_return = snprintf (addr, sizeof(addr), "%s@%s", username, domain);
mygid = getgid ();
time (&tclock);
- strncpy (from, adrsprintf (NULL, NULL), sizeof(from));
+ strncpy (from, getlocaladdr(), sizeof(from));
strncpy (myhost, LocalName (), sizeof(myhost));
for (cp = myhost; *cp; cp++)
if ((cp = getfullname ()) && *cp) {
strncpy (sigbuf, cp, sizeof(sigbuf));
snprintf (signature, sizeof(signature), "%s <%s>",
- sigbuf, adrsprintf (NULL, NULL));
+ sigbuf, getlocaladdr());
if ((cp = getname (signature)) == NULL)
adios (NULL, "getname () failed -- you lose extraordinarily big");
if ((mp = getm (cp, NULL, 0, AD_HOST, NULL)) == NULL)
while (getname (""))
continue;
} else {
- strncpy (signature, adrsprintf (NULL, NULL), sizeof(signature));
+ strncpy (signature, getlocaladdr(), sizeof(signature));
}
}