]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
rar reader: fix cast to unsigned int (#2209)
authorLukeSkyD <100560115+LukeSkyD@users.noreply.github.com>
Fri, 31 May 2024 14:11:12 +0000 (16:11 +0200)
committerGitHub <noreply@github.com>
Fri, 31 May 2024 14:11:12 +0000 (16:11 +0200)
Fixes compiler error `C4267: '+=': conversion from 'size_t' to 'unsigned int'.
Possible loss of data.` which stops compiling with MSVC.

libarchive/archive_read_support_format_rar.c

index 123813084ccb295181aa762a586400302b213dfb..354cb0d0bab560c69b7367f17e5e5a7a4f296a76 100644 (file)
@@ -3142,7 +3142,7 @@ copy_from_lzss_window_to_unp(struct archive_read *a, const void **buffer,
   } else {
       goto fatal;
   }
-  rar->unp_offset += length;
+  rar->unp_offset += (unsigned int) length;
   if (rar->unp_offset >= rar->unp_buffer_size)
     *buffer = rar->unp_buffer;
   else