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:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user