Only add the widths together for printable characters in prn_normal();

unprintable characters have a "width" of -1.
This commit is contained in:
Tim J. Robbins 2004-05-03 11:48:55 +00:00
parent 675d58e870
commit 6449b88bf1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128868

View File

@ -79,7 +79,8 @@ prn_normal(const char *s)
for (i = 0; i < (int)clen; i++)
putchar((unsigned char)s[i]);
s += clen;
n += wcwidth(wc);
if (iswprint(wc))
n += wcwidth(wc);
}
return (n);
}