mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
fix(string): correctly handle not found case in SStrStr
This commit is contained in:
parent
001edb9a7a
commit
611186db9e
2 changed files with 19 additions and 1 deletions
|
|
@ -234,8 +234,12 @@ const char* SStrStr(const char* string, const char* search) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
while (*substring && SStrCmp(substring, search, length)) {
|
||||
while (SStrCmp(substring, search, length)) {
|
||||
substring++;
|
||||
|
||||
if (!*substring) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return substring;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue