#include <stdlib.h>
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/ascii.h>
#include <lib-lib/macros.h>
#include "mutt.h"
-#include "ascii.h"
#include "mutt_idna.h"
-#include "lib/str.h"
#define terminate_string(a, b, c) do { if ((b) < (c)) a[(b)] = 0; else \
a[(c)] = 0; } while (0)
}
terminate_string (token, *tokenlen, tokenmax);
- addr->mailbox = str_dup (token);
+ addr->mailbox = m_strdup(token);
if (*commentlen && !addr->personal) {
terminate_string (comment, *commentlen, commentmax);
- addr->personal = str_dup (comment);
+ addr->personal = m_strdup(comment);
}
return s;
}
if (!addr->mailbox)
- addr->mailbox = str_dup ("@");
+ addr->mailbox = m_strdup("@");
s++;
return s;
}
else if (commentlen && last && !last->personal) {
terminate_buffer (comment, commentlen);
- last->personal = str_dup (comment);
+ last->personal = m_strdup(comment);
}
commentlen = 0;
else if (*s == ':') {
cur = rfc822_new_address ();
terminate_buffer (phrase, phraselen);
- cur->mailbox = str_dup (phrase);
+ cur->mailbox = m_strdup(phrase);
cur->group = 1;
if (last)
}
else if (commentlen && last && !last->personal) {
terminate_buffer (comment, commentlen);
- last->personal = str_dup (comment);
+ last->personal = m_strdup(comment);
}
/* add group terminator */
p_delete(&cur->personal);
/* if we get something like "Michael R. Elkins" remove the quotes */
rfc822_dequote_comment (phrase);
- cur->personal = str_dup (phrase);
+ cur->personal = m_strdup(phrase);
}
if ((ps =
parse_route_addr (s + 1, comment, &commentlen,
}
else if (commentlen && last && !last->personal) {
terminate_buffer (comment, commentlen);
- last->personal = str_dup (comment);
+ last->personal = m_strdup(comment);
}
return top;
for (; addr; addr = addr->next)
if (!addr->group && addr->mailbox && strchr (addr->mailbox, '@') == NULL) {
- p = p_new(char, str_len(addr->mailbox) + str_len(host) + 2);
+ p = p_new(char, m_strlen(addr->mailbox) + m_strlen(host) + 2);
sprintf (p, "%s@%s", addr->mailbox, host); /* __SPRINTF_CHECKED__ */
p_delete(&addr->mailbox);
addr->mailbox = p;
if (!buflen)
goto done;
strfcpy (pbuf, addr->personal, buflen);
- len = str_len (pbuf);
+ len = m_strlen(pbuf);
pbuf += len;
buflen -= len;
}
goto done;
if (ascii_strcmp (addr->mailbox, "@") && !display) {
strfcpy (pbuf, addr->mailbox, buflen);
- len = str_len (pbuf);
+ len = m_strlen(pbuf);
}
else if (ascii_strcmp (addr->mailbox, "@") && display) {
strfcpy (pbuf, mutt_addr_for_display (addr), buflen);
- len = str_len (pbuf);
+ len = m_strlen(pbuf);
}
else {
*pbuf = '\0';
int display)
{
char *pbuf = buf;
- size_t len = str_len (buf);
+ size_t len = m_strlen(buf);
buflen--; /* save room for the terminal nul */
/* this should be safe since we always have at least 1 char passed into
the above call, which means `pbuf' should always be nul terminated */
- len = str_len (pbuf);
+ len = m_strlen(pbuf);
pbuf += len;
buflen -= len;
{
ADDRESS *p = rfc822_new_address ();
- p->personal = str_dup (addr->personal);
- p->mailbox = str_dup (addr->mailbox);
+ p->personal = m_strdup(addr->personal);
+ p->mailbox = m_strdup(addr->mailbox);
p->group = addr->group;
return p;
}