Skip to content

Commit

Permalink
Adjust assertions in CTString::GetSubstr() and CTString::GetChar().
Browse files Browse the repository at this point in the history
Now they won't be triggered on empty strings when searching from the very beginning.
  • Loading branch information
DreamyCecil committed Feb 15, 2024
1 parent 9f49f26 commit f97a053
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Engine/Base/CTString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ CTString &CTString::Erase(size_t iFrom, size_t ct) {

// [Cecil] Find substring in a string
const char *CTString::GetSubstr(const char *strSub, size_t iFrom) const {
ASSERT(iFrom < Length());
ASSERT(iFrom <= Length());

// Inline implementation of strstr()
const size_t ct = strlen(strSub);
Expand All @@ -835,7 +835,7 @@ const char *CTString::GetSubstr(const char *strSub, size_t iFrom) const {

// [Cecil] Find character in a string
char *CTString::GetChar(char ch, size_t iFrom) const {
ASSERT(iFrom < Length());
ASSERT(iFrom <= Length());

// Inline implementation of strchr()
char *pch = str_String + iFrom;
Expand Down

0 comments on commit f97a053

Please sign in to comment.