From 56814c85dff9c497892a76cb43a65380880945cf Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 3 Feb 2022 09:47:50 -0500 Subject: Open with binary mode so Windows can seek properly --- dump.c | 2 +- system.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dump.c b/dump.c index 182a2b6..3e651b1 100644 --- a/dump.c +++ b/dump.c @@ -2,7 +2,7 @@ int dump_file(const char *filename, int style) { FILE *fp; - fp = fopen(filename, "r"); + fp = fopen(filename, "rb+"); if (!fp) { return -1; } diff --git a/system.c b/system.c index 39f40cc..0894f20 100644 --- a/system.c +++ b/system.c @@ -111,7 +111,7 @@ char *find_program(const char *name) { ssize_t get_file_size(const char *filename) { ssize_t result; FILE *fp; - fp = fopen(filename, "r"); + fp = fopen(filename, "rb+"); if (!fp) { return -1; } -- cgit