Rocco Rutte:
[apps/madmutt.git] / curs_lib.c
index 87d8721..b9c4557 100644 (file)
@@ -213,12 +213,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 = safe_malloc (COLS + 1);
+  answer_string = mem_malloc (COLS + 1);
   snprintf (answer_string, COLS + 1, " ([%s]/%s): ", def == M_YES ? yes : no,
             def == M_YES ? no : yes);
-  answer_string_len = mutt_strlen (answer_string);
+  answer_string_len = str_len (answer_string);
   printw ("%.*s%s", COLS - answer_string_len, msg, answer_string);
-  FREE (&answer_string);
+  mem_free (&answer_string);
 
   FOREVER {
     mutt_refresh ();
@@ -401,7 +401,7 @@ int mutt_do_pager (const char *banner,
 {
   int rc;
 
-  if (!Pager || mutt_strcmp (Pager, "builtin") == 0)
+  if (!Pager || str_cmp (Pager, "builtin") == 0)
     rc = mutt_pager (banner, tempfile, do_color, info);
   else {
     char cmd[STRING];
@@ -446,7 +446,7 @@ int _mutt_enter_fname (const char *prompt, char *buf, size_t blen,
     *redraw = REDRAW_FULL;
   }
   else {
-    char *pc = safe_malloc (mutt_strlen (prompt) + 3);
+    char *pc = mem_malloc (str_len (prompt) + 3);
 
     sprintf (pc, "%s: ", prompt);       /* __SPRINTF_CHECKED__ */
     mutt_ungetch (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
@@ -456,7 +456,7 @@ int _mutt_enter_fname (const char *prompt, char *buf, size_t blen,
         != 0)
       buf[0] = 0;
     MAYBE_REDRAW (*redraw);
-    FREE (&pc);
+    mem_free (&pc);
   }
 
   return 0;
@@ -470,7 +470,7 @@ void mutt_ungetch (int ch, int op)
   tmp.op = op;
 
   if (UngetCount >= UngetBufLen)
-    safe_realloc (&KeyEvent, (UngetBufLen += 128) * sizeof (event_t));
+    mem_realloc (&KeyEvent, (UngetBufLen += 128) * sizeof (event_t));
 
   KeyEvent[UngetCount++] = tmp;
 }
@@ -526,7 +526,7 @@ int mutt_multi_choice (char *prompt, char *letters)
       }
       else if (ch.ch <= '9' && ch.ch > '0') {
         choice = ch.ch - '0';
-        if (choice <= mutt_strlen (letters))
+        if (choice <= str_len (letters))
           break;
       }
     }
@@ -646,7 +646,7 @@ static void mutt_format_s_x (char *dest,
   }
 
   mutt_format_string (dest, destlen, min_width, max_width,
-                      right_justify, ' ', s, mutt_strlen (s), arboreal);
+                      right_justify, ' ', s, str_len (s), arboreal);
 }
 
 void mutt_format_s (char *dest,
@@ -671,7 +671,7 @@ void mutt_paddstr (int n, const char *s)
   wchar_t wc;
   int w;
   size_t k;
-  size_t len = mutt_strlen (s);
+  size_t len = str_len (s);
   mbstate_t mbstate;
 
   memset (&mbstate, 0, sizeof (mbstate));
@@ -695,7 +695,7 @@ void mutt_paddstr (int n, const char *s)
 }
 
 /*
- * mutt_strwidth is like mutt_strlen except that it returns the width
+ * mutt_strwidth is like str_len except that it returns the width
  * refering to the number of characters cells.
  */
 
@@ -709,7 +709,7 @@ int mutt_strwidth (const char *s)
   if (!s)
     return 0;
 
-  n = mutt_strlen (s);
+  n = str_len (s);
 
   memset (&mbstate, 0, sizeof (mbstate));
   for (w = 0; n && (k = mbrtowc (&wc, s, n, &mbstate)); s += k, n -= k) {