proc/escape.c: Handle negative wcwidth() return value.
This should never happen, because wcwidth() is called only if iswprint() returns nonzero. But belt-and-suspenders, and make it visually clear (very important for the next patch).
This commit is contained in:
parent
47303a3592
commit
8d359b04ab
@ -88,7 +88,7 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
|
|||||||
/* multibyte - printable */
|
/* multibyte - printable */
|
||||||
int wlen = wcwidth(wc);
|
int wlen = wcwidth(wc);
|
||||||
|
|
||||||
if (wlen==0) {
|
if (wlen<=0) {
|
||||||
// invisible multibyte -- we don't ignore it, because some terminal
|
// invisible multibyte -- we don't ignore it, because some terminal
|
||||||
// interpret it wrong and more safe is replace it with '?'
|
// interpret it wrong and more safe is replace it with '?'
|
||||||
*(dst++) = '?';
|
*(dst++) = '?';
|
||||||
|
Loading…
Reference in New Issue
Block a user