From: Arun Prakash Jana Date: Tue, 5 Nov 2019 14:33:12 +0000 (+0530) Subject: Clear buffer for no locale compilation X-Git-Tag: v2.8~103 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=8a7d2bd1edaa2f678a6dc6d62e840a96840fc9c5;p=nnn.git Clear buffer for no locale compilation --- diff --git a/src/nnn.c b/src/nnn.c index 675d8208..0346e819 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);