[dpkg] 91/187: libdpkg: Cast strlen() return value to ssize_t to match write() return type

Reiner Herrmann reiner at reiner-h.de
Sun Nov 6 12:46:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

deki-guest pushed a commit to branch master
in repository dpkg.

commit 236305c3359262726f698cf79bd030f7e004b164
Author: Guillem Jover <guillem at debian.org>
Date:   Thu Aug 25 01:02:59 2016 +0200

    libdpkg: Cast strlen() return value to ssize_t to match write() return type
    
    Warned-by: clang
---
 debian/changelog      | 1 +
 lib/dpkg/t/t-buffer.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index eaa6d01..828a48b 100644
--- a/debian/changelog
+++ b/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
diff --git a/lib/dpkg/t/t-buffer.c b/lib/dpkg/t/t-buffer.c
index 6aef1bb..2847e93 100644
--- a/lib/dpkg/t/t-buffer.c
+++ b/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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list