X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=edit.c;h=f5f93ac62a98634cccff996f585321ce9ecc9b0f;hp=2f1a377882785a7b165d8f7a0bc0f51a8bb6fb81;hb=1dc7032b59cc5b91d70076ed228bda8caf65a7f3;hpb=8e037c67a88cb4680c4391134c578e3b55a80f8a diff --git a/edit.c b/edit.c index 2f1a377..f5f93ac 100644 --- a/edit.c +++ b/edit.c @@ -14,6 +14,7 @@ #endif #include +#include #include "mutt.h" #include "ascii.h" @@ -21,8 +22,6 @@ #include "mutt_curses.h" #include "mutt_idna.h" -#include "lib/mem.h" -#include "lib/intl.h" #include "lib/str.h" #include @@ -78,11 +77,11 @@ static char **be_snarf_data (FILE * f, char **buf, int *bufmax, int *buflen, break; bytes -= str_len (p); if (*bufmax == *buflen) - mem_realloc (&buf, sizeof (char *) * (*bufmax += 25)); + p_realloc(&buf, *bufmax += 25); buf[(*buflen)++] = str_dup (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; @@ -158,7 +157,7 @@ static char **be_include_messages (char *msg, char **buf, int *bufmax, } if (*bufmax == *buflen) - mem_realloc (&buf, sizeof (char *) * (*bufmax += 25)); + p_realloc(&buf, *bufmax += 25); buf[(*buflen)++] = str_dup (tmp); bytes = Context->hdrs[n]->content->length; @@ -172,7 +171,7 @@ static char **be_include_messages (char *msg, char **buf, int *bufmax, pfx); if (*bufmax == *buflen) - mem_realloc (&buf, sizeof (char *) * (*bufmax += 25)); + p_realloc(&buf, *bufmax += 25); buf[(*buflen)++] = str_dup ("\n"); } else @@ -442,7 +441,7 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) else { str_cat (tmp, sizeof (tmp), "\n"); if (buflen == bufmax) - mem_realloc (&buf, sizeof (char *) * (bufmax += 25)); + p_realloc(&buf, bufmax += 25); buf[buflen++] = str_dup (tmp[1] == '~' ? tmp + 1 : tmp); }