From ad676623168e7b7b083f66617087c6cf424000d1 Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Sun, 15 Jan 2017 02:01:22 +0300 Subject: Fix tests --- src/tools/StringTools.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tools') diff --git a/src/tools/StringTools.cpp b/src/tools/StringTools.cpp index d5270db..a48b4eb 100644 --- a/src/tools/StringTools.cpp +++ b/src/tools/StringTools.cpp @@ -56,6 +56,8 @@ bool endsWith(const string& str1, const string& str2) { string::const_iterator begin1(str1.begin()); string::const_iterator it2(str2.end()); string::const_iterator begin2(str2.begin()); + --begin1; + --begin2; while (it1 != begin1 && it2 != begin2) { if (*it1 != *it2) { return false; -- cgit v1.2.3