This commit is contained in:
blueloveTH 2024-02-01 15:12:38 +08:00
parent 7a53ae47ee
commit 7182257413
2 changed files with 2 additions and 2 deletions

View File

@ -7,8 +7,7 @@ namespace pkpy{
// Skip utf8 BOM if there is any.
if (strncmp(source.data(), "\xEF\xBB\xBF", 3) == 0) index += 3;
// Drop all '\r'
// SStream ss(source.size());
SStream ss;
SStream ss(source.size());
while(index < source.size()){
if(source[index] != '\r') ss << source[index];
index++;

View File

@ -437,6 +437,7 @@ int utf8len(unsigned char c, bool suppress){
Str SStream::str(){
// after this call, the buffer is no longer valid
buffer.reserve(buffer.size() + 1); // allocate one more byte for '\0'
return Str(buffer.detach());
}