lib/mbsalign: Fix escaping nonprintable multibyte characters

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
This commit is contained in:
Vaclav Dolezal 2018-01-11 10:42:22 +01:00
parent 910a879f3d
commit edf86d6bc0
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ char *mbs_safe_encode_to_buffer(const char *s, size_t *width, char *buf, const c
} else if (!iswprint(wc)) {
size_t i;
for (i = 0; i < len; i++) {
sprintf(r, "\\x%02x", (unsigned char) *p);
sprintf(r, "\\x%02x", (unsigned char) p[i]);
r += 4;
*width += 4;
}