X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=query.c;h=58ece1f703e9dde5c5eec7df185aff8f630da612;hp=893d2db5e5db2a7583544df903079cbdba346365;hb=ebad7634114993e2e96fa66fda4b705d05832193;hpb=8e037c67a88cb4680c4391134c578e3b55a80f8a diff --git a/query.c b/query.c index 893d2db..58ece1f 100644 --- a/query.c +++ b/query.c @@ -19,7 +19,6 @@ #include "mapping.h" #include "sort.h" -#include "lib/mem.h" #include "lib/intl.h" #include "lib/str.h" #include "lib/debug.h" @@ -102,11 +101,11 @@ static QUERY *run_query (char *s, int quiet) if (first == NULL) { FirstColumn = 0; SecondColumn = 0; - first = (QUERY *) mem_calloc (1, sizeof (QUERY)); + first = p_new(QUERY, 1); cur = first; } else { - cur->next = (QUERY *) mem_calloc (1, sizeof (QUERY)); + cur->next = p_new(QUERY, 1); cur = cur->next; } @@ -289,8 +288,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) for (queryp = results; queryp; queryp = queryp->next) menu->max++; - menu->data = QueryTable = - (ENTRY *) mem_calloc (menu->max, sizeof (ENTRY)); + menu->data = QueryTable = p_new(ENTRY, menu->max); for (i = 0, queryp = results; queryp; queryp = queryp->next, i++) QueryTable[i].data = queryp; @@ -346,8 +344,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) menu->max++; if (op == OP_QUERY) { - menu->data = QueryTable = - (ENTRY *) mem_calloc (menu->max, sizeof (ENTRY)); + menu->data = QueryTable = p_new(ENTRY, menu->max); for (i = 0, queryp = results; queryp; queryp = queryp->next, i++) @@ -357,7 +354,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) int clear = 0; /* append */ - mem_realloc (&QueryTable, menu->max * sizeof (ENTRY)); + p_realloc(&QueryTable, menu->max); menu->data = QueryTable;