X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=color.c;h=5484bba0c05260eddeebec8349c5a6caebcdb2ff;hp=51d2f8381fd2150875e43cbcc04ea05fcbbf22e0;hb=364bf52ada05bf7d7158dba9d2391f63b71258f6;hpb=a8477ebaa09990b3688164cbe5cf661c4189541d diff --git a/color.c b/color.c index 51d2f83..5484bba 100644 --- a/color.c +++ b/color.c @@ -12,6 +12,8 @@ #endif #include "mutt.h" +#include "buffer.h" +#include "ascii.h" #include "mutt_curses.h" #include "mapping.h" @@ -96,7 +98,7 @@ static struct mapping_t Fields[] = { static COLOR_LINE *mutt_new_color_line (void) { - COLOR_LINE *p = safe_calloc (1, sizeof (COLOR_LINE)); + COLOR_LINE *p = mem_calloc (1, sizeof (COLOR_LINE)); p->fg = p->bg = -1; @@ -123,14 +125,14 @@ static void mutt_free_color_line (COLOR_LINE ** l, int free_colors) regfree (&tmp->rx); mutt_pattern_free (&tmp->color_pattern); - FREE (&tmp->pattern); - FREE (l); + mem_free (&tmp->pattern); + mem_free (l); } void ci_start_color (void) { memset (ColorDefs, A_NORMAL, sizeof (int) * MT_COLOR_MAX); - ColorQuote = (int *) safe_malloc (COLOR_QUOTE_INIT * sizeof (int)); + ColorQuote = (int *) mem_malloc (COLOR_QUOTE_INIT * sizeof (int)); memset (ColorQuote, A_NORMAL, sizeof (int) * COLOR_QUOTE_INIT); ColorQuoteSize = COLOR_QUOTE_INIT; ColorQuoteUsed = 0; @@ -223,7 +225,7 @@ int mutt_alloc_color (int fg, int bg) i++; } - p = (COLOR_LIST *) safe_malloc (sizeof (COLOR_LIST)); + p = (COLOR_LIST *) mem_malloc (sizeof (COLOR_LIST)); p->next = ColorList; ColorList = p; @@ -267,14 +269,14 @@ void mutt_free_color (int fg, int bg) if (p == ColorList) { ColorList = ColorList->next; - FREE (&p); + mem_free (&p); return; } q = ColorList; while (q) { if (q->next == p) { q->next = p->next; - FREE (&p); + mem_free (&p); return; } q = q->next; @@ -698,7 +700,7 @@ _mutt_parse_color (BUFFER * buf, BUFFER * s, BUFFER * err, } else if (object == MT_COLOR_QUOTED) { if (q_level >= ColorQuoteSize) { - safe_realloc (&ColorQuote, (ColorQuoteSize += 2) * sizeof (int)); + mem_realloc (&ColorQuote, (ColorQuoteSize += 2) * sizeof (int)); ColorQuote[ColorQuoteSize - 2] = ColorDefs[MT_COLOR_QUOTED]; ColorQuote[ColorQuoteSize - 1] = ColorDefs[MT_COLOR_QUOTED]; }