l10ntools/source/treemerge.cxx                    |    5 ++++-
 unodevtools/source/skeletonmaker/cpptypemaker.cxx |    3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 490e64cdc890c5998d54d4ad3c3ac85e7e8e3bee
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Sep 20 20:19:49 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Sep 22 20:10:23 2024 +0200

    cid#1607175 Overflowed constant
    
    and
    
    cid#1606656 Overflowed constant
    
    Change-Id: I278d3745ca5d22defde8ab268e644e9ee312a3cd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173751
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx
index 47bfec04ef46..5dc6455e7018 100644
--- a/l10ntools/source/treemerge.cxx
+++ b/l10ntools/source/treemerge.cxx
@@ -71,9 +71,12 @@ namespace
         const auto nAfterSlash = (nFirstSlash != std::string_view::npos) ? 
(nFirstSlash + 1) : 0;
         // Update id attribute of topic
         {
+            std::u16string_view::size_type nXhpSlash = rXhpRoot.rfind('/');
+            const auto nAfterXhpSlash = (nXhpSlash != 
std::u16string_view::npos) ? (nXhpSlash + 1) : 0;
+
             OString sNewID =
                 OString::Concat(sID.subView( 0, nAfterSlash )) +
-                rXhpRoot.substr( rXhpRoot.rfind('/') + 1 ) +
+                rXhpRoot.substr( nAfterXhpSlash ) +
                 sID.subView( sID.indexOf( '/', nAfterSlash ) );
             xmlSetProp(
                 pReturn, reinterpret_cast<const xmlChar*>("id"),
diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx 
b/unodevtools/source/skeletonmaker/cpptypemaker.cxx
index 481299c2e1c2..1423f2739a5b 100644
--- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx
+++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx
@@ -265,7 +265,8 @@ static void printConstructor(
     rtl::Reference< unoidl::Entity > const & entity, std::u16string_view name,
     std::vector< OUString > const & arguments)
 {
-    o << "public " << OUString(name.substr(name.rfind('.') + 1)) << '(';
+    std::u16string_view::size_type pos = name.rfind('.');
+    o << "public " << OUString(name.substr((pos != std::u16string_view::npos) 
? pos + 1 : 0)) << '(';
     printConstructorParameters(
         o, options, manager, sort, entity, name, arguments);
     o << ");
";

Reply via email to