lib/mbsalign: Fix escaping nonprintable multibyte characters
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
This commit is contained in:
parent
910a879f3d
commit
edf86d6bc0
|
@ -168,7 +168,7 @@ char *mbs_safe_encode_to_buffer(const char *s, size_t *width, char *buf, const c
|
||||||
} else if (!iswprint(wc)) {
|
} else if (!iswprint(wc)) {
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
sprintf(r, "\\x%02x", (unsigned char) *p);
|
sprintf(r, "\\x%02x", (unsigned char) p[i]);
|
||||||
r += 4;
|
r += 4;
|
||||||
*width += 4;
|
*width += 4;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue