move buffer.[hc] into lib-lib/
[apps/madmutt.git] / enter.c
diff --git a/enter.c b/enter.c
index b742739..95c26bd 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -87,7 +87,7 @@ static void my_wcstombs (char *dest, size_t dlen, const wchar_t * src,
   size_t k;
 
   /* First convert directly into the destination buffer */
-  memset (&st, 0, sizeof (st));
+  p_clear(&st, 1);
   for (; slen && dlen >= MB_LEN_MAX; dest += k, dlen -= k, src++, slen--)
     if ((k = wcrtomb (dest, *src, &st)) == (size_t) (-1))
       break;
@@ -129,7 +129,7 @@ size_t my_mbstowcs (wchar_t ** pwbuf, size_t * pwbuflen, size_t i, char *buf)
   size_t wbuflen;
 
   wbuf = *pwbuf, wbuflen = *pwbuflen;
-  memset (&st, 0, sizeof (st));
+  p_clear(&st, 1);
   for (; (k = mbrtowc (&wc, buf, MB_LEN_MAX, &st)) &&
        k != (size_t) (-1) && k != (size_t) (-2); buf += k) {
     if (i >= wbuflen) {
@@ -205,7 +205,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
 
   int rv = 0;
 
-  memset (&mbstate, 0, sizeof (mbstate));
+  p_clear(&mbstate, 1);
 
   if (state->wbuf) {
     /* Coming back after return 1 */
@@ -616,7 +616,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int y, int x,
         if (k == (size_t) (-2))
           continue;
         else if (k && k != 1) {
-          memset (&mbstate, 0, sizeof (mbstate));
+          p_clear(&mbstate, 1);
           continue;
         }
       }