Fix VString::endsWith when suffix is longer than input string.

This commit is contained in:
Geza Lore 2022-10-27 17:39:53 +01:00
parent ed93a111c2
commit 65290afe0a
1 changed files with 1 additions and 0 deletions

View File

@ -184,6 +184,7 @@ bool VString::startsWith(const string& str, const string& prefix) {
}
bool VString::endsWith(const string& str, const string& suffix) {
if (str.length() < suffix.length()) return false;
return str.compare(str.length() - suffix.length(), suffix.length(), suffix) == 0;
}