aboutsummaryrefslogtreecommitdiff
path: root/libelf/elf_rawfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/elf_rawfile.c')
-rw-r--r--libelf/elf_rawfile.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libelf/elf_rawfile.c b/libelf/elf_rawfile.c
index f63982fb0b4b..97abf06a2267 100644
--- a/libelf/elf_rawfile.c
+++ b/libelf/elf_rawfile.c
@@ -28,15 +28,13 @@
#include "_libelf.h"
-ELFTC_VCSID("$Id: elf_rawfile.c 3174 2015-03-27 17:13:41Z emaste $");
+ELFTC_VCSID("$Id: elf_rawfile.c 3712 2019-03-16 22:23:34Z jkoshy $");
char *
elf_rawfile(Elf *e, size_t *sz)
{
- size_t size;
unsigned char *ptr;
- size = e ? e->e_rawsize : 0;
ptr = NULL;
if (e == NULL)
@@ -45,7 +43,7 @@ elf_rawfile(Elf *e, size_t *sz)
LIBELF_SET_ERROR(SEQUENCE, 0);
if (sz)
- *sz = size;
+ *sz = e ? (size_t) e->e_rawsize : 0;
return ((char *) ptr);
}