#endif
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
#include "mutt.h"
#include "enter.h"
#include "nntp.h"
#endif
-#include "lib/mem.h"
-#include "lib/intl.h"
-#include "lib/str.h"
#include <errno.h>
#include <string.h>
if (t && t[0] == '0' && t[1] == '\0')
t = "<random>";
- if (c + str_len (t) + 2 >= COLS - SW)
+ if (c + m_strlen(t) + 2 >= COLS - SW)
break;
addstr (NONULL (t));
if (chain->next)
addstr (", ");
- c += str_len (t) + 2;
+ c += m_strlen(t) + 2;
}
}
#endif /* MIXMASTER */
&& buf[0]) {
p_delete(&msg->env->newsgroups);
str_skip_trailws (buf);
- msg->env->newsgroups = str_dup (str_skip_initws (buf));
+ msg->env->newsgroups = m_strdup(str_skip_initws (buf));
move (HDR_TO, HDR_XOFFSET);
clrtoeol ();
if (msg->env->newsgroups)
&& buf[0]) {
p_delete(&msg->env->followup_to);
str_skip_trailws (buf);
- msg->env->followup_to = str_dup (str_skip_initws (buf));
+ msg->env->followup_to = m_strdup(str_skip_initws (buf));
move (HDR_CC, HDR_XOFFSET);
clrtoeol ();
if (msg->env->followup_to)
if (mutt_get_field ("X-Comment-To: ", buf, sizeof (buf), 0) == 0
&& buf[0]) {
p_delete(&msg->env->x_comment_to);
- msg->env->x_comment_to = str_dup (buf);
+ msg->env->x_comment_to = m_strdup(buf);
move (HDR_BCC, HDR_XOFFSET);
clrtoeol ();
if (msg->env->x_comment_to)
if (!(WithCrypto & APPLICATION_PGP))
break;
if (idxlen == idxmax) {
- mem_realloc (&idx, sizeof (ATTACHPTR *) * (idxmax += 5));
+ p_realloc(&idx, idxmax += 5);
menu->data = idx;
}
- idx[idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen] = p_new(ATTACHPTR, 1);
if ((idx[idxlen]->content =
crypt_pgp_make_key_attachment (NULL)) != NULL) {
update_idx (menu, idx, idxlen++);
break;
if (idxlen + numfiles >= idxmax) {
- mem_realloc (&idx,
- sizeof (ATTACHPTR *) * (idxmax += 5 + numfiles));
+ p_realloc(&idx, idxmax += 5 + numfiles);
menu->data = idx;
}
for (i = 0; i < numfiles; i++) {
char *att = files[i];
- idx[idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen] = p_new(ATTACHPTR, 1);
idx[idxlen]->unowned = 1;
idx[idxlen]->content = mutt_make_file_attach (att);
if (idx[idxlen]->content != NULL)
}
if (idxlen + Context->tagged >= idxmax) {
- mem_realloc (&idx,
- sizeof (ATTACHPTR *) * (idxmax +=
- 5 + Context->tagged));
+ p_realloc(&idx, idxmax += 5 + Context->tagged);
menu->data = idx;
}
for (i = 0; i < Context->msgcount; i++) {
h = Context->hdrs[i];
if (h->tagged) {
- idx[idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen] = p_new(ATTACHPTR, 1);
idx[idxlen]->content = mutt_make_message_attach (Context, h, 1);
if (idx[idxlen]->content != NULL)
update_idx (menu, idx, idxlen++);
continue;
}
if (idxlen == idxmax) {
- mem_realloc (&idx, sizeof (ATTACHPTR *) * (idxmax += 5));
+ p_realloc(&idx, idxmax += 5);
menu->data = idx;
}
- idx[idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR));
+ idx[idxlen] = p_new(ATTACHPTR, 1);
/* Touch the file */
if (!(fp = safe_fopen (fname, "w"))) {
mutt_error (_("Can't create file %s"), fname);