1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-01 09:47:35 +03:00

shared/bootspec: avoid signed-unsigned comparison

../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)
      |                       ^~
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-03-15 11:05:26 +01:00
parent 75910ed9f4
commit a75fcef8fb

View File

@ -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. */