aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--paxmacho.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/paxmacho.c b/paxmacho.c
index 090fc18..142af6e 100644
--- a/paxmacho.c
+++ b/paxmacho.c
@@ -189,16 +189,12 @@ inline static uint32_t read_mach_header(fatobj *fobj, void *addr)
* arch. */
fatobj *readmacho(const char *filename)
{
- struct stat st;
int fd;
- if (stat(filename, &st) == -1)
- return NULL;
-
if ((fd = open(filename, O_RDONLY)) == -1)
return NULL;
- return readmacho_fd(filename, fd, st.st_size);
+ return readmacho_fd(filename, fd, 0);
}
fatobj *readmacho_fd(const char *filename, int fd, size_t len)