exit mem_realloc, enters p_realloc/xrealloc.
[apps/madmutt.git] / enter.c
diff --git a/enter.c b/enter.c
index 1b97bd4..4841111 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -22,7 +22,6 @@
 #include "history.h"
 #include "buffy.h"
 
-#include "lib/mem.h"
 
 #include <string.h>
 
@@ -135,7 +134,7 @@ size_t my_mbstowcs (wchar_t ** pwbuf, size_t * pwbuflen, size_t i, char *buf)
        k != (size_t) (-1) && k != (size_t) (-2); buf += k) {
     if (i >= wbuflen) {
       wbuflen = i + 20;
-      mem_realloc (&wbuf, wbuflen * sizeof (*wbuf));
+      p_realloc(&wbuf, wbuflen);
     }
     wbuf[i++] = wc;
   }
@@ -161,7 +160,7 @@ static void replace_part (ENTER_STATE *state, size_t from, const char *buf)
   /* Make space for suffix */
   if (state->curpos + savelen > state->wbuflen) {
     state->wbuflen = state->curpos + savelen;
-    mem_realloc (&state->wbuf, state->wbuflen * sizeof (wchar_t));
+    p_realloc(&state->wbuf, state->wbuflen);
   }
 
   /* Restore suffix */
@@ -471,7 +470,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
           }
           if (!mutt_complete (buf, buflen)) {
             templen = state->lastchar - i;
-            mem_realloc (&tempbuf, templen * sizeof (wchar_t));
+            p_realloc(&tempbuf, templen);
           }
           else
             BEEP ();
@@ -539,7 +538,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
 
           if (!mutt_complete (buf, buflen)) {
             templen = state->lastchar;
-            mem_realloc (&tempbuf, templen * sizeof (wchar_t));
+            p_realloc(&tempbuf, templen);
             memcpy (tempbuf, state->wbuf, templen * sizeof (wchar_t));
           }
           else
@@ -649,7 +648,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
       else if (wc && (wc < ' ' || IsWPrint (wc))) {     /* why? */
         if (state->lastchar >= state->wbuflen) {
           state->wbuflen = state->lastchar + 20;
-          mem_realloc (&state->wbuf, state->wbuflen * sizeof (wchar_t));
+          p_realloc(&state->wbuf, state->wbuflen);
         }
         memmove (state->wbuf + state->curpos + 1, state->wbuf + state->curpos,
                  (state->lastchar - state->curpos) * sizeof (wchar_t));