diff --git a/ncurses.c b/ncurses.c --- a/ncurses.c +++ b/ncurses.c @@ -38,7 +38,7 @@ { wchar_t guess; - char dest[4]; + char dest[6]; int maxx; int maxy; @@ -53,10 +53,7 @@ maxx = getmaxx (win); maxy = getmaxy (win); - dest[0] = 0; - dest[1] = 0; - dest[2] = 0; - dest[3] = 0; + memset (&dest, 0, sizeof (dest)); if (wctomb (dest, guess) == -1) { perror ("WCTOMB"); return -1;