From 795940e4acb56d4085c93072b4def0310bf2b4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 18 Sep 2024 17:42:18 +0100 Subject: [PATCH] cid#1606864 Overflowed constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I08beb9bd76065ea846171e07fbf6e427ada37360 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173667 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sal/cppunittester/cppunittester.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index 610f8a8155ef..b1dcbfcd155e 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -356,7 +356,8 @@ double get_time(timeval* time) OString generateTestName(std::u16string_view rPath) { size_t nPathSep = rPath.rfind('/'); - std::u16string_view aTestName = rPath.substr(nPathSep+1); + size_t nAfterPathSep = (nPathSep != std::string_view::npos) ? (nPathSep + 1) : 0; + std::u16string_view aTestName = rPath.substr(nAfterPathSep); return OUStringToOString(aTestName, RTL_TEXTENCODING_UTF8); }