diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:25 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:25 +0200 |
commit | 1767b21eb219fb9ac332aca9f7c3abecd97b6b39 (patch) | |
tree | 95ac07953f40ebbd6a674024ad4fc6b9f952e1f9 /RichString.c | |
parent | c74c38760df69bb87e93dff18cf91464e5d02f37 (diff) | |
download | debian_htop-1767b21eb219fb9ac332aca9f7c3abecd97b6b39.tar.gz debian_htop-1767b21eb219fb9ac332aca9f7c3abecd97b6b39.tar.bz2 debian_htop-1767b21eb219fb9ac332aca9f7c3abecd97b6b39.zip |
Imported Upstream version 0.8.1+svn149upstream/0.8.1+svn149
Diffstat (limited to 'RichString.c')
-rw-r--r-- | RichString.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/RichString.c b/RichString.c index c397f3f..fbcb17f 100644 --- a/RichString.c +++ b/RichString.c @@ -9,6 +9,7 @@ #include <stdlib.h> #include <string.h> #include <curses.h> +#include <ctype.h> #include "debug.h" #include <assert.h> @@ -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; } |