From 99c38aba9f198c45f3496b68fda60cd4f0f09067 Mon Sep 17 00:00:00 2001 From: Tamas TEVESZ Date: Mon, 25 Jul 2011 17:12:18 +0200 Subject: [PATCH] Silence fread()-related signedness warnings --- elf32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elf32.c b/elf32.c index e0eb228..da36598 100644 --- a/elf32.c +++ b/elf32.c @@ -51,7 +51,7 @@ static int read_ehdr(struct elf32_info *info, FILE *in) { /* Read and check the ELF header */ rewind(in); - if (fread(&info->file_ehdr, sizeof(info->file_ehdr), 1, in) < 0) { + if (fread(&info->file_ehdr, sizeof(info->file_ehdr), 1, in) == 0) { pr_error("elf32: couldn't read ELF header"); return -1; } @@ -83,7 +83,7 @@ static int read_phdr(struct elf32_info *info, FILE *in) } if (fread(&info->file_phdrs[i], - sizeof(info->file_phdrs[0]), 1, in) < 0) { + sizeof(info->file_phdrs[0]), 1, in) == 0) { printc_err("elf32: can't read phdr %d: %s\n", i, strerror(errno)); return -1; @@ -112,7 +112,7 @@ static int read_shdr(struct elf32_info *info, FILE *in) } if (fread(&info->file_shdrs[i], - sizeof(info->file_shdrs[0]), 1, in) < 0) { + sizeof(info->file_shdrs[0]), 1, in) == 0) { printc_err("elf32: can't read shdr %d: %s\n", i, strerror(errno)); return -1;