]> Sergey Matveev's repositories - nnn.git/commitdiff
Clear buffer for no locale compilation
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 5 Nov 2019 14:33:12 +0000 (20:03 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 5 Nov 2019 14:33:12 +0000 (20:03 +0530)
src/nnn.c

index 675d8208a78f7c9e95ef58cfa745335d2ef64d72..0346e81910b0fc3f41e559de56cf8df4812bdb6a 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2398,6 +2398,11 @@ static char *unescape(const char *str, uint maxcols, wchar_t **wstr)
        static wchar_t wbuf[NAME_MAX + 1] __attribute__ ((aligned));
        wchar_t *buf = wbuf;
        size_t lencount = 0;
+
+#ifdef NOLOCALE
+       memset(wbuf, 0, sizeof(wbuf));
+#endif
+
        /* Convert multi-byte to wide char */
        size_t len = mbstowcs(wbuf, str, NAME_MAX);