3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00
This commit is contained in:
Nikolaj Bjorner 2022-02-20 15:32:41 +02:00
parent 14ee02183c
commit f66b4f0880

View file

@ -216,7 +216,7 @@ int zstring::indexofu(zstring const& other, unsigned offset) const {
int zstring::last_indexof(zstring const& other) const {
if (other.length() == 0) return length();
if (other.length() > length()) return -1;
for (unsigned last = length() - other.length(); last-- > 0; ) {
for (unsigned last = length() - other.length() + 1; last-- > 0; ) {
bool suffix = true;
for (unsigned j = 0; suffix && j < other.length(); ++j) {
suffix = m_buffer[last + j] == other[j];