Skip to content
Snippets Groups Projects
Commit f766c741 authored by Jani Juvan's avatar Jani Juvan
Browse files

Fixed sign-compare warnings

parent 19c8fda5
Branches
No related tags found
1 merge request!8Consolidate make flags into package makefile and harden them
......@@ -113,7 +113,7 @@ static ssize_t copy_data(int out_fd, int in_fd, ssize_t size)
while (left > 0) {
char buf[4096];
ssize_t count = sizeof(buf) < left ? sizeof(buf) : left;
ssize_t count = (ssize_t)sizeof(buf) < left ? (ssize_t)sizeof(buf) : left;
ssize_t written;
count = read(in_fd, buf, count);
......@@ -277,14 +277,14 @@ char *read_header(int fd)
return NULL;
len = read(fd, buf, FDT_V1_SIZE);
if (len < FDT_V1_SIZE) {
if (len < (ssize_t)FDT_V1_SIZE) {
free(buf);
return NULL;
}
/* Read rest of header */
total_size = fdt_totalsize(buf);
if (total_size < FDT_V1_SIZE) {
if (total_size < (ssize_t)FDT_V1_SIZE) {
free(buf);
return NULL;
}
......@@ -297,7 +297,7 @@ char *read_header(int fd)
buf = tmp;
len = read(fd, buf + FDT_V1_SIZE, total_size - FDT_V1_SIZE);
if (len < total_size - FDT_V1_SIZE) {
if (len < total_size - (ssize_t)FDT_V1_SIZE) {
free(buf);
return NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment