]> Sergey Matveev's repositories - nnn.git/commitdiff
Reduce get_wch() array length and initialization.
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 20 Jul 2022 13:19:24 +0000 (18:49 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 20 Jul 2022 13:19:24 +0000 (18:49 +0530)
src/nnn.c

index 18e4c601d086c5d7a39e1c4c8f9aab6bb89cdbd3..a45e66df00acaeb412d438c7571ae2f90b84fe08 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3247,7 +3247,7 @@ static int filterentries(char *path, char *lastname)
 {
        wchar_t *wln = (wchar_t *)alloca(sizeof(wchar_t) * REGEX_MAX);
        char *ln = g_ctx[cfg.curctx].c_fltr;
-       wint_t ch[2] = {0};
+       wint_t ch[1];
        int r, total = ndents, len;
        char *pln = g_ctx[cfg.curctx].c_fltr + 1;
 
@@ -3454,7 +3454,7 @@ static char *xreadline(const char *prefill, const char *prompt)
        size_t len, pos;
        int x, r;
        const int WCHAR_T_WIDTH = sizeof(wchar_t);
-       wint_t ch[2] = {0};
+       wint_t ch[1];
        wchar_t * const buf = malloc(sizeof(wchar_t) * READLINE_MAX);
 
        if (!buf)