# include "config.h"
#endif
+#include <lib-lib/macros.h>
+
#include "mutt.h"
#include "mbyte.h"
#include "charset.h"
-#include "lib/intl.h"
#include <errno.h>
ib = buf;
ob = s;
obl = MB_LEN_MAX;
- r = iconv (cd, &ib, &ibl, &ob, &obl);
+ r = my_iconv(cd, &ib, &ibl, &ob, &obl);
}
else {
ib = "";
ibl = 1;
ob = buf;
obl = sizeof (buf);
- r = iconv (cd, &ib, &ibl, &ob, &obl);
+ r = my_iconv(cd, &ib, &ibl, &ob, &obl);
}
return ob - s;
}
ibl = 1;
for (;;) {
- r = iconv (cd, &ib, &ibl, &ob, &obl);
+ 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;
}
}
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);
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)