diff options
author | 2019-02-12 08:52:31 +0530 | |
---|---|---|
committer | 2019-02-12 08:54:42 +0530 | |
commit | 6d9f4b37102aec9ae3e89fd9c0591d8b965d8f25 (patch) | |
tree | 5fe3afa72763a5e118e8d13338fca17bb9624a37 | |
parent | b99a28a3761ee864fd3cf5150c49bc6c7ffc1f5a (diff) | |
download | nnn-6d9f4b37102aec9ae3e89fd9c0591d8b965d8f25.tar.gz |
Terminate string only once
-rw-r--r-- | src/nnn.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1884,10 +1884,10 @@ static char *unescape(const char *str, uint maxcols) if (maxcols) { len = lencount = wcswidth(wbuf, len); - while (len > maxcols) { - wbuf[--lencount] = L'\0'; - len = wcswidth(wbuf, lencount); - } + while (len > maxcols) + len = wcswidth(wbuf, --lencount); + + wbuf[lencount] = L'\0'; } while (*buf) { |