diff options
author | Clifford Wolf <clifford@clifford.at> | 2016-03-28 16:51:44 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2016-03-28 16:51:44 +0200 |
commit | a1fd644f383e77d4db71ce4654fdf15b940b53a6 (patch) | |
tree | d5560518430e8d5953f417abda55a73e53346ec1 /iceprog/iceprog.c | |
parent | 6178dfbbd612d15a46c7d2a439b2252d6d0a87ba (diff) | |
parent | 3587093560aa0e5d4d78cde02e397116e8cdf173 (diff) | |
download | icestorm-a1fd644f383e77d4db71ce4654fdf15b940b53a6.tar.gz icestorm-a1fd644f383e77d4db71ce4654fdf15b940b53a6.tar.bz2 icestorm-a1fd644f383e77d4db71ce4654fdf15b940b53a6.zip |
Merge pull request #35 from benpye/fix-iceprog-windows
Fix iceprog on Windows opening binary in text mode
Diffstat (limited to 'iceprog/iceprog.c')
-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(); |