drop mem_alloc and mem_free, use my own hand crafted optmized macros that
[apps/madmutt.git] / curs_lib.c
index 0cb31c6..9f8b8aa 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"
@@ -201,12 +203,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 +466,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 +476,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;