diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-02-03 16:21:55 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-02-03 20:27:29 +0100 |
commit | b66c5f77d150056b2de262dae66301fcd7dc38c1 (patch) | |
tree | be6cb75524abff6f1fbfda2c62fd2ce5cb132e2f /shell/source | |
parent | 86af52b119eaf57b7c1f8943cc1c6631f2044482 (diff) |
loplugin:unsignedcompare (clang-cl)
Change-Id: I69cc1b352221ca053ccd0c5b78e926480a8c9ccd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87884
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'shell/source')
-rw-r--r-- | shell/source/win32/zipfile/zipfile.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/shell/source/win32/zipfile/zipfile.cxx b/shell/source/win32/zipfile/zipfile.cxx index 1462c161a900..a1b2b40e628c 100644 --- a/shell/source/win32/zipfile/zipfile.cxx +++ b/shell/source/win32/zipfile/zipfile.cxx @@ -29,6 +29,8 @@ #include <string.h> +#include <o3tl/safeint.hxx> + namespace { @@ -450,7 +452,7 @@ void ZipFile::GetUncompressedContent( return; m_pStream->sseek(end.cdir_offset, SEEK_SET); CentralDirectoryEntry entry; - while (m_pStream->stell() != -1 && static_cast<unsigned long>(m_pStream->stell()) < end.cdir_offset + end.cdir_size) + while (m_pStream->stell() != -1 && o3tl::make_unsigned(m_pStream->stell()) < end.cdir_offset + end.cdir_size) { if (!readCentralDirectoryEntry(m_pStream, entry)) return; @@ -522,7 +524,7 @@ ZipFile::DirectoryPtr_t ZipFile::GetDirectory() const return dir; m_pStream->sseek(end.cdir_offset, SEEK_SET); CentralDirectoryEntry entry; - while (m_pStream->stell() != -1 && static_cast<unsigned long>(m_pStream->stell()) < end.cdir_offset + end.cdir_size) + while (m_pStream->stell() != -1 && o3tl::make_unsigned(m_pStream->stell()) < end.cdir_offset + end.cdir_size) { if (!readCentralDirectoryEntry(m_pStream, entry)) return dir; @@ -559,7 +561,7 @@ long ZipFile::GetFileLongestFileNameLength() const return lmax; m_pStream->sseek(end.cdir_offset, SEEK_SET); CentralDirectoryEntry entry; - while (m_pStream->stell() != -1 && static_cast<unsigned long>(m_pStream->stell()) < end.cdir_offset + end.cdir_size) + while (m_pStream->stell() != -1 && o3tl::make_unsigned(m_pStream->stell()) < end.cdir_offset + end.cdir_size) { if (!readCentralDirectoryEntry(m_pStream, entry)) return lmax; |