writerperfect/source/common/WPXSvInputStream.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 9f6927e882b8e4f207ec632f0802a6136a165d88
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Aug 22 21:45:13 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Aug 23 18:10:45 2023 +0200

    cid#1541186 Operands don't affect result
    
    We probably manually silenced this in the past, so now it has returned
    after the code has changed enough to trigger it.
    
    I don't think we need to check for LONG_MAX in this case, we only return
    0 or -1 here anyway.
    
    Change-Id: Ic2ba171a8c7c3f74d98088434a85e947fcadf7b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155958
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/writerperfect/source/common/WPXSvInputStream.cxx 
b/writerperfect/source/common/WPXSvInputStream.cxx
index fa5984dc842e..2bcef2b52824 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -453,19 +453,20 @@ int WPXSvInputStream::seek(tools::Long offset)
         return -1;
 
     const sal_Int64 tmpPosition = mxSeekable->getPosition();
-    if ((tmpPosition < 0) || (tmpPosition > LONG_MAX))
+    if (tmpPosition < 0)
         return -1;
 
     try
     {
         mxSeekable->seek(offset);
-        return 0;
     }
     catch (...)
     {
         SAL_WARN("writerperfect", "mxSeekable->seek(offset) threw exception");
         return -1;
     }
+
+    return 0;
 }
 
 bool WPXSvInputStream::isStructured()

Reply via email to