From 7ceb645926e7902cfe9cc84d6ab55be64946601c Mon Sep 17 00:00:00 2001 From: simon987 Date: Fri, 6 Mar 2020 09:34:41 -0500 Subject: [PATCH] hotfix invalid read in text_buffer --- src/util.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util.h b/src/util.h index 69230fa..945629a 100644 --- a/src/util.h +++ b/src/util.h @@ -257,12 +257,7 @@ static int text_buffer_append_string(text_buffer_t *buf, char *str, size_t len) __always_inline static int text_buffer_append_string0(text_buffer_t *buf, char *str) { - utf8_int32_t c; - for (void *v = utf8codepoint(str, &c); c != '\0'; v = utf8codepoint(v, &c)) { - if (utf8_validchr2(v)) { - text_buffer_append_char(buf, c); - } - } + return text_buffer_append_string(buf, str, strlen(str)); } __always_inline