diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-04-26 14:39:28 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-04-26 17:08:19 +0200 |
commit | a8d01742e98d29a57be6d990b7331f789bc3a5ee (patch) | |
tree | 25a3194477e28d66a4925cfeec0be24abc31179e | |
parent | bdff0bb77b57def835fcaed3bded7519e69dc896 (diff) |
Improve some signed vs. unsigned comparisons
p2-fwd will always be non-negative
Change-Id: I143d7fd3c5ec192ffaeb56bc2e9f45ac5e83cb6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133439
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | ucb/source/ucp/ftp/ftpurl.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 7910a293d570..13b7e839c3e9 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/ucb/OpenMode.hpp> #include <string.h> #include <rtl/uri.hxx> +#include <o3tl/safeint.hxx> #include "ftpurl.hxx" #include "ftpcontentprovider.hxx" @@ -458,8 +459,8 @@ std::vector<FTPDirentry> FTPURL::list( OUString viewurl(ident(true,false)); while(true) { - while(p2-fwd < int(len) && *p2 != '\n') ++p2; - if(p2-fwd == int(len)) break; + while(o3tl::make_unsigned(p2-fwd) < len && *p2 != '\n') ++p2; + if(o3tl::make_unsigned(p2-fwd) == len) break; *p2 = 0; switch(osKind) { |