diff options
author | Ben Pye <ben@curlybracket.co.uk> | 2016-03-27 22:14:16 +0100 |
---|---|---|
committer | Ben Pye <ben@curlybracket.co.uk> | 2016-03-27 22:14:16 +0100 |
commit | 3587093560aa0e5d4d78cde02e397116e8cdf173 (patch) | |
tree | d5560518430e8d5953f417abda55a73e53346ec1 | |
parent | 6178dfbbd612d15a46c7d2a439b2252d6d0a87ba (diff) | |
download | icestorm-3587093560aa0e5d4d78cde02e397116e8cdf173.tar.gz icestorm-3587093560aa0e5d4d78cde02e397116e8cdf173.tar.bz2 icestorm-3587093560aa0e5d4d78cde02e397116e8cdf173.zip |
Fix iceprog on Windows opening binary in text mode
-rw-r--r-- | iceprog/iceprog.c | 8 |
1 files changed, 4 insertions, 4 deletions
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(); |