From a75fcef8fb6d70711fabf23df44766c94285822d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 15 Mar 2019 11:05:26 +0100 Subject: [PATCH] shared/bootspec: avoid signed-unsigned comparison MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ../src/shared/bootspec.c: In function ‘find_sections’: ../src/shared/bootspec.c:425:23: warning: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 425 | if (n != size) | ^~ --- src/shared/bootspec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 59930464bc0..af8da15236a 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -422,7 +422,7 @@ static int find_sections( n = pread(fd, k, size, offset); if (n < 0) return log_error_errno(errno, "Failed to read section payload: %m"); - if (n != size) + if ((size_t) n != size) return log_error_errno(SYNTHETIC_ERRNO(EIO), "Short read while reading section payload, refusing:"); /* Allow one trailing NUL byte, but nothing more. */ -- 2.47.3