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

This commit is contained in:
Geza Lore
2022-10-27 18:38:44 +01:00
parent ed93a111c2
commit 65290afe0a
+1
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;
}