Skip to content

Commit

Permalink
Engine: fixed String.Substring()
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-mogilko committed Nov 3, 2023
1 parent bbb5e0b commit df5c5f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Engine/ac/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const char* String_Substring(const char *thisString, int index, int length) {
size_t end = uoffset(thisString + start, sublen) + start;
size_t copylen = end - start;

auto buf = ScriptString::CreateBuffer(copylen, length); // arg is a text length
auto buf = ScriptString::CreateBuffer(copylen, sublen);
memcpy(buf.Get(), thisString + start, copylen);
buf.Get()[copylen] = 0;
return CreateNewScriptString(std::move(buf));
Expand Down

0 comments on commit df5c5f1

Please sign in to comment.