diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2021-01-27 19:33:49 +1100 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2021-02-12 13:41:47 +1100 |
commit | 26d8ba170355c951e53c08c357121d96bdb54076 (patch) | |
tree | 837809aefc4d61889aa803904585f4040ab2d4d4 /lib/libelf/elf.c | |
parent | 0549fa7d08dc9865e25b2af1a46f8ccbe46fd312 (diff) | |
download | SLOF-26d8ba170355c951e53c08c357121d96bdb54076.zip SLOF-26d8ba170355c951e53c08c357121d96bdb54076.tar.gz SLOF-26d8ba170355c951e53c08c357121d96bdb54076.tar.bz2 |
elf: Compile with -Wextra
-Wextra enables a bunch of rather useful checks which this fixes.
This changes the return value for the case when no ELF headers were found
to avoid (ugly-ish) cast of -1 to unsigned.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
Changes:
v2:
* cast the return value to (int)
* added missing (long)
Diffstat (limited to 'lib/libelf/elf.c')
-rw-r--r-- | lib/libelf/elf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libelf/elf.c b/lib/libelf/elf.c index d368454..f6a052e 100644 --- a/lib/libelf/elf.c +++ b/lib/libelf/elf.c @@ -202,7 +202,7 @@ elf_get_base_addr(void *file_addr) * buffer larger than the size of the file * @return The size of the ELF image or < 0 for error */ -long elf_get_file_size(const void *buffer, const long buffer_size) +long elf_get_file_size(const void *buffer, const unsigned long buffer_size) { const struct ehdr *ehdr = (const struct ehdr *)buffer; |