In 'od -c' mode, deal with printable but zero-width combining

characters correctly.  These characters are displayed "combined"
with a space character.

PR:		misc/100215
Submitted by:	"J.R. Oldroyd" <<fbsd AT opal.com>>
Reviewed by:	"J.R. Oldroyd" <<fbsd AT opal.com>> (revised patch)
MFC after:	3 days
This commit is contained in:
Joseph Koshy 2006-07-31 14:17:04 +00:00
parent b7141b2e2a
commit 1ae9926515
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160857

View File

@ -134,7 +134,7 @@ conv_c(PR *pr, u_char *p, size_t bufsize)
*pr->cchar = 'C';
assert(strcmp(pr->fmt, "%3C") == 0);
width = wcwidth(wc);
assert(width > 0);
assert(width >= 0);
pad = 3 - width;
if (pad < 0)
pad = 0;