X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=curs_lib.c;h=a5b3a22625d0da1b3c7f6cf1cd6d2bc7d0544c47;hp=e5f9480a8596a035678325aca8322e2480573e93;hb=617e7d83d14e14e6a520a48e75437211b16c8834;hpb=ea912b20ba2b3b9dfdbbae758ad56263c9aa41b3 diff --git a/curs_lib.c b/curs_lib.c index e5f9480..a5b3a22 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -15,6 +15,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "enter.h" #include "mutt_menu.h" @@ -22,11 +24,11 @@ #include "pager.h" #include "mbyte.h" -#include "lib/mem.h" #include "lib/intl.h" #include "lib/str.h" #include "lib/debug.h" +#include #include #include #include @@ -200,12 +202,12 @@ int mutt_yesorno (const char *msg, int def) * ensure there is enough room for the answer and truncate the question * to fit. */ - answer_string = mem_malloc (COLS + 1); + answer_string = p_new(char, COLS + 1); snprintf (answer_string, COLS + 1, " ([%s]/%s): ", def == M_YES ? yes : no, def == M_YES ? no : yes); answer_string_len = str_len (answer_string); printw ("%.*s%s", COLS - answer_string_len, msg, answer_string); - mem_free (&answer_string); + p_delete(&answer_string); FOREVER { mutt_refresh (); @@ -463,7 +465,7 @@ int _mutt_enter_fname (const char *prompt, char *buf, size_t blen, *redraw = REDRAW_FULL; } else { - char *pc = mem_malloc (str_len (prompt) + 3); + char *pc = p_new(char, str_len(prompt) + 3); sprintf (pc, "%s: ", prompt); /* __SPRINTF_CHECKED__ */ mutt_ungetch (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0); @@ -473,7 +475,7 @@ int _mutt_enter_fname (const char *prompt, char *buf, size_t blen, != 0) buf[0] = 0; MAYBE_REDRAW (*redraw); - mem_free (&pc); + p_delete(&pc); } return 0; @@ -487,7 +489,7 @@ void mutt_ungetch (int ch, int op) tmp.op = op; if (UngetCount >= UngetBufLen) - mem_realloc (&KeyEvent, (UngetBufLen += 128) * sizeof (event_t)); + p_realloc(&KeyEvent, UngetBufLen += 128); KeyEvent[UngetCount++] = tmp; }