summaryrefslogtreecommitdiffstats
path: root/RichString.c
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-11-01 01:09:51 +0100
committerBenny Baumann <BenBE@geshi.org>2020-11-02 22:15:01 +0100
commit45869513bfebba80cc2ab42e4218f68b34b1e6ac (patch)
treef064631dbff141bf1c945db8cff40b7bb82fd169 /RichString.c
parent61e14d4bb25268593019e6df3eb02264b4ac8e0e (diff)
Embracing branches
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 99c535b1..904b44b6 100644
--- a/RichString.c
+++ b/RichString.c
@@ -52,6 +52,7 @@ static inline void RichString_writeFrom(RichString* this, int attrs, const char*
len = mbstowcs(data, data_c, len);
if (len < 0)
return;
+
int newLen = from + len;
RichString_setLen(this, newLen);
for (int i = from, j = 0; i < newLen; i++, j++) {
@@ -84,8 +85,9 @@ int RichString_findChar(RichString* this, char c, int start) {
static inline void RichString_writeFrom(RichString* this, int attrs, const char* data_c, int from, int len) {
int newLen = from + len;
RichString_setLen(this, newLen);
- for (int i = from, j = 0; i < newLen; i++, j++)
+ for (int i = from, j = 0; i < newLen; i++, j++) {
this->chptr[i] = (data_c[j] >= 32 ? data_c[j] : '?') | attrs;
+ }
this->chptr[newLen] = 0;
}

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