X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=curs_lib.c;h=a5b3a22625d0da1b3c7f6cf1cd6d2bc7d0544c47;hp=0cb31c61735bfafc6e3d035ca8ecebd65099bf91;hb=617e7d83d14e14e6a520a48e75437211b16c8834;hpb=c25bc063f35aaad6938c2022dae7a283346c2769 diff --git a/curs_lib.c b/curs_lib.c index 0cb31c6..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,7 +24,6 @@ #include "pager.h" #include "mbyte.h" -#include "lib/mem.h" #include "lib/intl.h" #include "lib/str.h" #include "lib/debug.h" @@ -201,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 (); @@ -464,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); @@ -474,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; @@ -488,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; }