aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-11-05 20:03:12 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-11-05 20:03:12 +0530
commit8a7d2bd1edaa2f678a6dc6d62e840a96840fc9c5 (patch)
treeb27eb71bd38c0b4e1b20dd4e1e28033be1b5d126 /src
parent94e4dc51ba7ebcbdaf94dc3bb20c59ee22dc84e5 (diff)
downloadnnn-8a7d2bd1edaa2f678a6dc6d62e840a96840fc9c5.tar.gz
Clear buffer for no locale compilation
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 675d820..0346e81 100644
--- 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);