Windows: use binary open

This commit is contained in:
Shahram Najm 2019-03-14 12:34:41 +00:00
parent a77570cd19
commit 79b1853de8
3 changed files with 4 additions and 4 deletions

View File

@ -135,7 +135,7 @@ static int split_file_by_subtype(FILE* in, const char* filename, unsigned long *
if (verbose) {
if (!file_exists(ofilename)) printf("Writing output to %s\n", ofilename);
}
out=fopen(ofilename,"a");
out=fopen(ofilename,"ab");
if (!out) {
fprintf(stderr,"ERROR: Failed to open output file '%s'\n", ofilename);
perror(ofilename);
@ -183,7 +183,7 @@ int main(int argc,char* argv[])
return 1;
}
}
infh=fopen(filename,"r");
infh=fopen(filename,"rb");
if (!infh) {
perror(filename);
return 1;

View File

@ -91,7 +91,7 @@ int main(int argc,char* argv[])
if (strcmp(filename,"-")==0)
infh=stdin;
else
infh=fopen(filename,"r");
infh=fopen(filename,"rb");
if (!infh) {
perror(filename);
exit(1);

View File

@ -127,7 +127,7 @@ int main(int argc,char* argv[])
return 1;
}
}
infh=fopen(filename,"r");
infh=fopen(filename,"rb");
if (!infh) {
perror(filename);
return 1;