From 1767b21eb219fb9ac332aca9f7c3abecd97b6b39 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 11 Apr 2016 13:00:25 +0200 Subject: Imported Upstream version 0.8.1+svn149 --- RichString.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'RichString.c') diff --git a/RichString.c b/RichString.c index c397f3f..fbcb17f 100644 --- a/RichString.c +++ b/RichString.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "debug.h" #include @@ -89,7 +90,8 @@ int RichString_findChar(RichString *this, char c, int start) { inline void RichString_appendn(RichString* this, int attrs, char* data_c, int len) { int last = MIN(RICHSTRING_MAXLEN - 1, len + this->len); for (int i = this->len, j = 0; i < last; i++, j++) - this->chstr[i] = data_c[j] | attrs; + this->chstr[i] = (isprint(data_c[j]) ? data_c[j] : '?') | attrs; + this->chstr[last] = 0; this->len = last; } -- cgit v1.2.3