aboutsummaryrefslogtreecommitdiffstats
path: root/RichString.c
diff options
context:
space:
mode:
authorEugene V. Lyubimkin <jackyf.devel@gmail.com>2009-04-05 11:51:34 +0300
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:26 +0200
commit702a055ada42e05340e6dd61b86760ff2446c159 (patch)
treeb25687c188c3646378d43bc8b5c05757c1e596d3 /RichString.c
parent8f33fa7a49b4c60564309f356a37f2a1dfe20c34 (diff)
parent1767b21eb219fb9ac332aca9f7c3abecd97b6b39 (diff)
downloaddebian_htop-050b0ff2754e468a697d334b07615a6f62ce968f.tar.gz
debian_htop-050b0ff2754e468a697d334b07615a6f62ce968f.tar.bz2
debian_htop-050b0ff2754e468a697d334b07615a6f62ce968f.zip
Imported Debian patch 0.8.1+svn149-1debian/0.8.1+svn149-1
Diffstat (limited to 'RichString.c')
-rw-r--r--RichString.c4
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;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy