From 16cad15decb7e975fa71610f26d96ed1898cdb01 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 2 Aug 2019 12:24:32 +0200 Subject: [PATCH] change test for trimming non-printable chars --- src/util/unicode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/unicode.c b/src/util/unicode.c index cbc2db7cc..3d11ed230 100644 --- a/src/util/unicode.c +++ b/src/util/unicode.c @@ -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 {