aboutsummaryrefslogtreecommitdiffstats
path: root/iceprog
diff options
context:
space:
mode:
authorBen Pye <ben@curlybracket.co.uk>2016-03-27 22:14:16 +0100
committerBen Pye <ben@curlybracket.co.uk>2016-03-27 22:14:16 +0100
commit3587093560aa0e5d4d78cde02e397116e8cdf173 (patch)
treed5560518430e8d5953f417abda55a73e53346ec1 /iceprog
parent6178dfbbd612d15a46c7d2a439b2252d6d0a87ba (diff)
downloadicestorm-3587093560aa0e5d4d78cde02e397116e8cdf173.tar.gz
icestorm-3587093560aa0e5d4d78cde02e397116e8cdf173.tar.bz2
icestorm-3587093560aa0e5d4d78cde02e397116e8cdf173.zip
Fix iceprog on Windows opening binary in text mode
Diffstat (limited to 'iceprog')
-rw-r--r--iceprog/iceprog.c8
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();