X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pager.c;h=13f39080cf9aa356463cce9b51c439cf8b2b2282;hp=2a5cadf23dbc909de8a50311e0de35e0ae25c79a;hb=2ea77d3b2827ba23feb756ce2fb936565ae38998;hpb=7f7a0be369840b290248e5b0302beb447fa1b3cd diff --git a/pager.c b/pager.c index 2a5cadf..13f3908 100644 --- a/pager.c +++ b/pager.c @@ -687,8 +687,8 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last, else if (check_attachment_marker ((char *) raw) == 0) lineInfo[n].type = MT_COLOR_ATTACHMENT; #endif - else if (str_cmp ("-- \n", buf) == 0 - || str_cmp ("-- \r\n", buf) == 0) { + else if (m_strcmp("-- \n", buf) == 0 + || m_strcmp("-- \r\n", buf) == 0) { i = n + 1; lineInfo[n].type = MT_COLOR_SIGNATURE; @@ -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);