aboutsummaryrefslogtreecommitdiffstats
path: root/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-09-01 17:50:14 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-09-01 17:50:14 +0530
commit2e3f013ce33fc1b37252e409fa4a778ddd3116e5 (patch)
tree5ed4268cece98cd94b0ba73450f051fe2aed2f63 /nnn.c
parentdcc9b627600bce25f33ec401a19c60fac85fbf1f (diff)
downloadnnn-2e3f013ce33fc1b37252e409fa4a778ddd3116e5.tar.gz
Remove redundant variable
Diffstat (limited to 'nnn.c')
-rw-r--r--nnn.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nnn.c b/nnn.c
index 8b71ae5..8882561 100644
--- a/nnn.c
+++ b/nnn.c
@@ -1168,7 +1168,7 @@ unescape(const char *str, uint maxcols)
static char buffer[PATH_MAX];
static wchar_t wbuf[PATH_MAX];
static wchar_t *buf;
- static size_t len, width;
+ static size_t len;
buffer[0] = '\0';
buf = wbuf;
@@ -1176,10 +1176,10 @@ unescape(const char *str, uint maxcols)
/* Convert multi-byte to wide char */
len = mbstowcs(wbuf, str, PATH_MAX);
- if (maxcols) {
- width = wcswidth(wbuf, len);
+ if (maxcols && len > maxcols) {
+ len = wcswidth(wbuf, len);
- if (width > maxcols)
+ if (len > maxcols)
wbuf[maxcols] = 0;
}