summaryrefslogtreecommitdiffstats
path: root/contrib/file/readelf.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2007-05-24 21:59:38 +0000
committerobrien <obrien@FreeBSD.org>2007-05-24 21:59:38 +0000
commit240c77918bbcf0d5f67799916b808b8a65d434c5 (patch)
treef1050a93b4cf4d5e56408bc87c1da5741ccf4e65 /contrib/file/readelf.c
parent09615277daeb6e2f432f5fd5dbc254e4b0428f99 (diff)
downloadFreeBSD-src-240c77918bbcf0d5f67799916b808b8a65d434c5.zip
FreeBSD-src-240c77918bbcf0d5f67799916b808b8a65d434c5.tar.gz
Virgin import of Christos Zoulas's FILE 4.21.
Diffstat (limited to 'contrib/file/readelf.c')
-rw-r--r--contrib/file/readelf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/file/readelf.c b/contrib/file/readelf.c
index 69318fa..dd9004b 100644
--- a/contrib/file/readelf.c
+++ b/contrib/file/readelf.c
@@ -37,7 +37,7 @@
#include "readelf.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: readelf.c,v 1.61 2006/11/15 15:53:23 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.63 2007/01/16 14:56:45 ljt Exp $")
#endif
#ifdef ELFCORE
@@ -155,7 +155,7 @@ getu64(int swap, uint64_t value)
#define xph_type (class == ELFCLASS32 \
? getu32(swap, ph32.p_type) \
: getu32(swap, ph64.p_type))
-#define xph_offset (class == ELFCLASS32 \
+#define xph_offset (off_t)(class == ELFCLASS32 \
? getu32(swap, ph32.p_offset) \
: getu64(swap, ph64.p_offset))
#define xph_align (size_t)((class == ELFCLASS32 \
@@ -293,7 +293,7 @@ dophn_core(struct magic_set *ms, int class, int swap, int fd, off_t off,
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
- if (lseek(fd, (off_t)xph_offset, SEEK_SET) == (off_t)-1) {
+ if (lseek(fd, xph_offset, SEEK_SET) == (off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -858,7 +858,7 @@ dophn_exec(struct magic_set *ms, int class, int swap, int fd, off_t off,
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
- if (lseek(fd, (off_t)xph_offset, SEEK_SET)
+ if (lseek(fd, xph_offset, SEEK_SET)
== (off_t)-1) {
file_badseek(ms);
return -1;
OpenPOWER on IntegriCloud