X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mbyte.c;h=6c9a76c96613a079ff63f939775baf0131930015;hp=c9f35401063703ce627d49ea883e0548fe8098b9;hb=ae0ce4dfcafa0c3820f107c5bfa8bd06e5272b57;hpb=5e53f9e5f65aa5b3af6f5af9d868403536534afb diff --git a/mbyte.c b/mbyte.c index c9f3540..6c9a76c 100644 --- a/mbyte.c +++ b/mbyte.c @@ -15,11 +15,12 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "mbyte.h" #include "charset.h" -#include "lib/intl.h" #include @@ -171,7 +172,7 @@ size_t mbrtowc_iconv (wchar_t * pwc, const char *s, size_t n, r = my_iconv(cd, &ib, &ibl, &ob, &obl); if (ob > bufo && (!k || ib > bufi + k)) { /* we have a character */ - memset (ps, 0, sizeof (*ps)); + p_clear(ps, 1); utf8rtowc (pwc, bufo, ob - bufo, &mbstate); return (pwc && *pwc) ? (ib - (k ? bufi + k : s)) : 0; } @@ -188,7 +189,7 @@ size_t mbrtowc_iconv (wchar_t * pwc, const char *s, size_t n, } else { /* save the state and give up */ - memset (ps, 0, sizeof (*ps)); + p_clear(ps, 1); if (ibl <= sizeof (mbstate_t)) /* need extra condition here! */ memcpy (ps, ib, ibl); return (size_t) (-2); @@ -215,7 +216,7 @@ size_t mbrtowc (wchar_t * pwc, const char *s, size_t n, mbstate_t * ps) return mbrtowc_iconv (pwc, s, n, ps, charset_to_utf8); else { if (!s) { - memset (ps, 0, sizeof (*ps)); + p_clear(ps, 1); return 0; } if (!n)