X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pager.c;h=2e4aa39e883eb925c08af5f131977c5922422c7f;hp=bd1b2a8e21c8cb2fd353ce1f9f6e07365e7b2eb4;hb=3e611c4b53a33408955152e1c9336f8643ea096e;hpb=617e7d83d14e14e6a520a48e75437211b16c8834 diff --git a/pager.c b/pager.c index bd1b2a8..2e4aa39 100644 --- a/pager.c +++ b/pager.c @@ -16,6 +16,8 @@ #endif #include +#include +#include #include "mutt.h" #include "enter.h" @@ -39,8 +41,6 @@ #include "mutt_crypt.h" -#include "lib/intl.h" -#include "lib/str.h" #include "lib/rx.h" #include "lib/debug.h" @@ -887,7 +887,7 @@ static int trim_incomplete_mbyte(unsigned char *buf, size_t len) { mbstate_t mbstate; size_t k; - memset (&mbstate, 0, sizeof (mbstate)); + p_clear(&mbstate, 1); for (; len > 0; buf += k, len -= k) { k = mbrtowc (NULL, (char *) buf, len, &mbstate); if (k == -2) @@ -981,7 +981,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf, wrap_cols = COLS; /* FIXME: this should come from lineInfo */ - memset (&mbstate, 0, sizeof (mbstate)); + p_clear(&mbstate, 1); for (ch = 0, vch = 0; ch < cnt; ch += k, vch += k) { /* Handle ANSI sequences */ @@ -1146,7 +1146,7 @@ display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n, if (*last == *max) { p_realloc(lineInfo, *max += LINES); for (ch = *last; ch < *max; ch++) { - memset (&((*lineInfo)[ch]), 0, sizeof (struct line_t)); + p_clear(&(*lineInfo)[ch], 1); (*lineInfo)[ch].type = -1; (*lineInfo)[ch].search_cnt = -1; (*lineInfo)[ch].syntax = p_new(struct syntax_t, 1); @@ -1462,7 +1462,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra) lineInfo = p_new(struct line_t, maxLine = LINES); for (i = 0; i < maxLine; i++) { - memset (&lineInfo[i], 0, sizeof (struct line_t)); + p_clear(&lineInfo[i], 1); lineInfo[i].type = -1; lineInfo[i].search_cnt = -1; lineInfo[i].syntax = p_new(struct syntax_t, 1);