From 5a763af970b45fead35cd4c3318494216e2e470e Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 25 Feb 2024 17:05:51 +0200 Subject: [PATCH] lib/mu-store: don't assume non-empty in remove_slash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HT: Arsen Arsenović Fixes #2633. --- lib/mu-store.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mu-store.cc b/lib/mu-store.cc index 1f2f43f7..eff05e34 100644 --- a/lib/mu-store.cc +++ b/lib/mu-store.cc @@ -52,7 +52,7 @@ static std::string remove_slash(const std::string& str) { auto clean{str}; - while (clean[clean.length() - 1] == '/') + while (!clean.empty() && clean[clean.length() - 1] == '/') clean.pop_back(); return clean;