mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
Terminate string only once
This commit is contained in:
parent
b99a28a376
commit
6d9f4b3710
|
@ -1884,10 +1884,10 @@ static char *unescape(const char *str, uint maxcols)
|
||||||
|
|
||||||
if (maxcols) {
|
if (maxcols) {
|
||||||
len = lencount = wcswidth(wbuf, len);
|
len = lencount = wcswidth(wbuf, len);
|
||||||
while (len > maxcols) {
|
while (len > maxcols)
|
||||||
wbuf[--lencount] = L'\0';
|
len = wcswidth(wbuf, --lencount);
|
||||||
len = wcswidth(wbuf, lencount);
|
|
||||||
}
|
wbuf[lencount] = L'\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*buf) {
|
while (*buf) {
|
||||||
|
|
Loading…
Reference in a new issue