From 3587093560aa0e5d4d78cde02e397116e8cdf173 Mon Sep 17 00:00:00 2001 From: Ben Pye Date: Sun, 27 Mar 2016 22:14:16 +0100 Subject: Fix iceprog on Windows opening binary in text mode --- iceprog/iceprog.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'iceprog/iceprog.c') diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c index 26f893f..82b0560 100644 --- a/iceprog/iceprog.c +++ b/iceprog/iceprog.c @@ -490,7 +490,7 @@ int main(int argc, char **argv) // --------------------------------------------------------- FILE *f = (strcmp(filename, "-") == 0) ? stdin : - fopen(filename, "r"); + fopen(filename, "rb"); if (f == NULL) { fprintf(stderr, "Error: Can't open '%s' for reading: %s\n", filename, strerror(errno)); error(); @@ -546,7 +546,7 @@ int main(int argc, char **argv) if (!read_mode && !check_mode) { FILE *f = (strcmp(filename, "-") == 0) ? stdin : - fopen(filename, "r"); + fopen(filename, "rb"); if (f == NULL) { fprintf(stderr, "Error: Can't open '%s' for reading: %s\n", filename, strerror(errno)); error(); @@ -599,7 +599,7 @@ int main(int argc, char **argv) if (read_mode) { FILE *f = (strcmp(filename, "-") == 0) ? stdout : - fopen(filename, "w"); + fopen(filename, "wb"); if (f == NULL) { fprintf(stderr, "Error: Can't open '%s' for writing: %s\n", filename, strerror(errno)); error(); @@ -618,7 +618,7 @@ int main(int argc, char **argv) else { FILE *f = (strcmp(filename, "-") == 0) ? stdin : - fopen(filename, "r"); + fopen(filename, "rb"); if (f == NULL) { fprintf(stderr, "Error: Can't open '%s' for reading: %s\n", filename, strerror(errno)); error(); -- cgit v1.2.3