X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=query.c;h=1e1937d685ac74cd8921082e26c5f00d04024609;hp=ba3a5a49df55d89da2fe38d22907353e2a8a685f;hb=3e611c4b53a33408955152e1c9336f8643ea096e;hpb=b3cb6ed8d36c550a2e589910ce51bbc8352ff57c diff --git a/query.c b/query.c index ba3a5a4..1e1937d 100644 --- a/query.c +++ b/query.c @@ -12,6 +12,8 @@ #endif #include +#include +#include #include "mutt.h" #include "mutt_menu.h" @@ -19,9 +21,6 @@ #include "mapping.h" #include "sort.h" -#include "lib/mem.h" -#include "lib/intl.h" -#include "lib/str.h" #include "lib/debug.h" #include @@ -64,7 +63,7 @@ static ADDRESS *result_to_addr (QUERY * r) tmp = rfc822_cpy_adr (r->addr); if (!tmp->next && !tmp->personal) - tmp->personal = str_dup (r->name); + tmp->personal = m_strdup(r->name); mutt_addrlist_to_idna (tmp, NULL); return tmp; @@ -120,10 +119,10 @@ static QUERY *run_query (char *s, int quiet) l = mutt_strwidth (p); if (l > FirstColumn) FirstColumn = l; - cur->name = str_dup (p); + cur->name = m_strdup(p); p = strtok (NULL, "\t\n"); if (p) { - cur->other = str_dup (p); + cur->other = m_strdup(p); } } } @@ -187,7 +186,7 @@ static void query_entry (char *s, size_t slen, MUTTMENU * m, int num) mutt_format_string (buf2, sizeof (buf2), FirstColumn + 2, FirstColumn + 2, 0, ' ', table[num].data->name, - str_len (table[num].data->name), 0); + m_strlen(table[num].data->name), 0); snprintf (s, slen, " %c %3d %s %-*.*s %s", table[num].tagged ? '*' : ' ', @@ -355,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; @@ -433,7 +432,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) int tagged = 0; size_t curpos = 0; - memset (buf, 0, buflen); + p_clear(buf, buflen); /* check for tagged entries */ for (i = 0; i < menu->max; i++) { @@ -444,7 +443,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) mutt_addrlist_to_local (tmpa); tagged = 1; rfc822_write_address (buf, buflen, tmpa, 0); - curpos = str_len (buf); + curpos = m_strlen(buf); rfc822_free_address (&tmpa); } else if (curpos + 2 < buflen) { @@ -454,7 +453,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) strcat (buf, ", "); /* __STRCAT_CHECKED__ */ rfc822_write_address ((char *) buf + curpos + 1, buflen - curpos - 1, tmpa, 0); - curpos = str_len (buf); + curpos = m_strlen(buf); rfc822_free_address (&tmpa); } }