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 /sal | |
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 'sal')
-rw-r--r-- | sal/osl/w32/socket.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx index b0173357c187..52f6738e8205 100644 --- a/sal/osl/w32/socket.cxx +++ b/sal/osl/w32/socket.cxx @@ -30,6 +30,7 @@ #include <rtl/byteseq.h> #include <sal/log.hxx> #include <o3tl/char16_t2wchar_t.hxx> +#include <o3tl/safeint.hxx> #include <comphelper/windowserrorstring.hxx> #include "sockimpl.hxx" @@ -641,7 +642,7 @@ oslSocketResult SAL_CALL osl_getLocalHostname (rtl_uString **strLocalHostname) (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)) - && sal_uInt32(u.getLength()) < SAL_N_ELEMENTS(LocalHostname)) + && o3tl::make_unsigned(u.getLength()) < SAL_N_ELEMENTS(LocalHostname)) { memcpy(LocalHostname, u.getStr(), (u.getLength() + 1) * sizeof (sal_Unicode)); } |