#endif
#include <lib-lib/mem.h>
+#include <lib-lib/ascii.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
#include "mutt.h"
-#include "ascii.h"
#include "enter.h"
#include "mutt_curses.h"
#include "mutt_idna.h"
-#include "lib/mem.h"
-#include "lib/intl.h"
-#include "lib/str.h"
#include <stdio.h>
#include <string.h>
tmp[sizeof (tmp) - 1] = 0;
if (prefix) {
strfcpy (tmp, NONULL (Prefix), sizeof (tmp));
- tmplen = str_len (tmp);
+ tmplen = m_strlen(tmp);
p = tmp + tmplen;
tmplen = sizeof (tmp) - tmplen;
}
while (bytes > 0) {
if (fgets (p, tmplen - 1, f) == NULL)
break;
- bytes -= str_len (p);
+ bytes -= m_strlen(p);
if (*bufmax == *buflen)
- mem_realloc (&buf, sizeof (char *) * (*bufmax += 25));
- buf[(*buflen)++] = str_dup (tmp);
+ p_realloc(&buf, *bufmax += 25);
+ buf[(*buflen)++] = m_strdup(tmp);
}
if (buf && *bufmax == *buflen) { /* Do not smash memory past buf */
- mem_realloc (&buf, sizeof (char *) * (++*bufmax));
+ p_realloc(&buf, ++*bufmax);
}
if (buf)
buf[*buflen] = NULL;
}
if (*bufmax == *buflen)
- mem_realloc (&buf, sizeof (char *) * (*bufmax += 25));
- buf[(*buflen)++] = str_dup (tmp);
+ p_realloc(&buf, *bufmax += 25);
+ buf[(*buflen)++] = m_strdup(tmp);
bytes = Context->hdrs[n]->content->length;
if (inc_hdrs) {
pfx);
if (*bufmax == *buflen)
- mem_realloc (&buf, sizeof (char *) * (*bufmax += 25));
- buf[(*buflen)++] = str_dup ("\n");
+ p_realloc(&buf, *bufmax += 25);
+ buf[(*buflen)++] = m_strdup("\n");
}
else
printw (_("%d: invalid message number.\n"), n);
if (EscChar && tmp[0] == EscChar[0] && tmp[1] != EscChar[0]) {
/* remove trailing whitespace from the line */
- p = tmp + str_len (tmp) - 1;
+ p = tmp + m_strlen(tmp) - 1;
while (p >= tmp && ISSPACE (*p))
*p-- = 0;
if (Context) {
if (!*p && cur) {
/* include the current message */
- p = tmp + str_len (tmp) + 1;
- snprintf (tmp + str_len (tmp),
- sizeof (tmp) - str_len (tmp), " %d",
+ p = tmp + m_strlen(tmp) + 1;
+ snprintf (tmp + m_strlen(tmp),
+ sizeof (tmp) - m_strlen(tmp), " %d",
cur->msgno + 1);
}
buf = be_include_messages (p, buf, &bufmax, &buflen,
if (buflen) {
buflen--;
strfcpy (tmp, buf[buflen], sizeof (tmp));
- tmp[str_len (tmp) - 1] = 0;
+ tmp[m_strlen(tmp) - 1] = 0;
p_delete(&buf[buflen]);
buf[buflen] = NULL;
continue;
else {
str_cat (tmp, sizeof (tmp), "\n");
if (buflen == bufmax)
- mem_realloc (&buf, sizeof (char *) * (bufmax += 25));
- buf[buflen++] = str_dup (tmp[1] == '~' ? tmp + 1 : tmp);
+ p_realloc(&buf, bufmax += 25);
+ buf[buflen++] = m_strdup(tmp[1] == '~' ? tmp + 1 : tmp);
}
tmp[0] = 0;