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