change test for trimming non-printable chars

This commit is contained in:
Enno Rehling 2019-08-02 12:24:32 +02:00
parent a2a7bc5f61
commit 16cad15dec
1 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ size_t unicode_utf8_trim(char *buf)
++result;
}
}
if (op == buf && (iswcntrl(wc) || iswspace(wc))) {
if (op == buf && (iswspace(wc) || !iswprint(wc))) {
result += size;
}
else if (wc>255 || !iscntrl(wc)) {
@ -64,7 +64,7 @@ size_t unicode_utf8_trim(char *buf)
memmove(op, ip, size);
}
op += size;
if (iswcntrl(wc) || iswspace(wc)) {
if (iswspace(wc) || !iswprint(wc)) {
ts += size;
}
else {