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) ...@@ -113,7 +113,7 @@ static ssize_t copy_data(int out_fd, int in_fd, ssize_t size)
while (left > 0) { while (left > 0) {
char buf[4096]; 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; ssize_t written;
count = read(in_fd, buf, count); count = read(in_fd, buf, count);
...@@ -277,14 +277,14 @@ char *read_header(int fd) ...@@ -277,14 +277,14 @@ char *read_header(int fd)
return NULL; return NULL;
len = read(fd, buf, FDT_V1_SIZE); len = read(fd, buf, FDT_V1_SIZE);
if (len < FDT_V1_SIZE) { if (len < (ssize_t)FDT_V1_SIZE) {
free(buf); free(buf);
return NULL; return NULL;
} }
/* Read rest of header */ /* Read rest of header */
total_size = fdt_totalsize(buf); total_size = fdt_totalsize(buf);
if (total_size < FDT_V1_SIZE) { if (total_size < (ssize_t)FDT_V1_SIZE) {
free(buf); free(buf);
return NULL; return NULL;
} }
...@@ -297,7 +297,7 @@ char *read_header(int fd) ...@@ -297,7 +297,7 @@ char *read_header(int fd)
buf = tmp; buf = tmp;
len = read(fd, buf + FDT_V1_SIZE, total_size - FDT_V1_SIZE); 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); free(buf);
return NULL; return NULL;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment