From 554a9e8efe71f9bc0aa19b61d8e2cefda7b03a37 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Thu, 16 Feb 2023 08:53:08 -0800 Subject: [PATCH] fix #6346 --- src/util/zstring.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/zstring.cpp b/src/util/zstring.cpp index 570510458..7d2b4296a 100644 --- a/src/util/zstring.cpp +++ b/src/util/zstring.cpp @@ -214,7 +214,8 @@ int zstring::indexofu(zstring const& other, unsigned offset) const { } int zstring::last_indexof(zstring const& other) const { - if (other.length() == 0) return length(); + if (length() == 0 && other.length() == 0) return 0; + if (other.length() == 0) return -1; if (other.length() > length()) return -1; for (unsigned last = length() - other.length() + 1; last-- > 0; ) { bool suffix = true;