exit mem_realloc, enters p_realloc/xrealloc.
[apps/madmutt.git] / curs_lib.c
index 0cb31c6..a5b3a22 100644 (file)
@@ -15,6 +15,8 @@
 # include "config.h"
 #endif
 
+#include <lib-lib/mem.h>
+
 #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;
 }