From 25d36840adc4874aaeceb9d7beeca6f83dbf8408 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 1 Feb 2024 11:59:48 +0800 Subject: [PATCH] some fix --- src/str.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/str.cpp b/src/str.cpp index aa4004b0..ef2a7464 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -24,7 +24,8 @@ int utf8len(unsigned char c, bool suppress){ for(int i=0; isize; i++){ \ this->data[i] = __s[i]; \ if(!isascii(__s[i])) is_ascii = false; \ - } + } \ + this->data[this->size] = '\0'; Str::Str(): size(0), is_ascii(true), data(_inlined) { _inlined[0] = '\0'; @@ -71,6 +72,7 @@ int utf8len(unsigned char c, bool suppress){ if(other.is_inlined()){ data = _inlined; for(int i=0; i