Open binary files in binary mode

The "b" flag to fopen() is generally a no-op on Unix-like systems, but may
be important on other systems, including Windows.

Signed-off-by: Andrei Errapart <andrei@errapartengineering.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Andrei Errapart 2014-06-19 21:12:27 +10:00 committed by David Gibson
parent 25a9bd6267
commit 83e606a64d
3 changed files with 3 additions and 3 deletions

View file

@ -77,7 +77,7 @@ static char *try_open(const char *dirname, const char *fname, FILE **fp)
else
fullname = join_path(dirname, fname);
*fp = fopen(fullname, "r");
*fp = fopen(fullname, "rb");
if (!*fp) {
free(fullname);
fullname = NULL;