Просмотр исходного кода

libdpkg: Cast strlen() return value to ssize_t to match write() return type

Warned-by: clang
Guillem Jover лет назад: 10
Родитель
Сommit
236305c335
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      debian/changelog
  2. 1 1
      lib/dpkg/t/t-buffer.c

+ 1 - 0
debian/changelog

@@ -33,6 +33,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
   * Portability:
     - Cast off_t variables to intmax_t when printing them with "%jd".
     - Add missing <string.h> include in libdpkg.
+    - Cast strlen() return value to ssize_t to match write() return type.
   * Perl modules:
     - Obsolete Source-Version substvar in Dpkg::Substvars by emitting errors.
     - Rework keyring hooks in Dpkg::Vendor. Deprecate the keyrings hook, and

+ 1 - 1
lib/dpkg/t/t-buffer.c

@@ -62,7 +62,7 @@ test_fdio_hash(void)
 	test_pass(fd_md5(fd, hash, -1, NULL) >= 0);
 	test_str(hash, ==, ref_hash_empty);
 
-	test_pass(write(fd, str_test, strlen(str_test)) == strlen(str_test));
+	test_pass(write(fd, str_test, strlen(str_test)) == (ssize_t)strlen(str_test));
 	test_pass(lseek(fd, 0, SEEK_SET) == 0);
 
 	test_pass(fd_md5(fd, hash, -1, NULL) >= 0);