From 544c7efa6b9add8086a8170ee503b66e924c0875 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 20 Aug 2015 02:07:24 -0300 Subject: Omit non-printable characters with widechar curses. Closes PR #111. --- RichString.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'RichString.c') diff --git a/RichString.c b/RichString.c index ffed3ee0..a5cc64f7 100644 --- a/RichString.c +++ b/RichString.c @@ -98,7 +98,7 @@ static inline void RichString_writeFrom(RichString* this, int attrs, const char* for (int i = from, j = 0; i < newLen; i++, j++) { CharType* c = &(this->chptr[i]); c->attr = attrs; - c->chars[0] = data[j]; + c->chars[0] = (iswprint(data[j]) ? data[j] : '?'); c->chars[1] = 0; } this->chptr[newLen].chars[0] = 0; -- cgit v1.2.3