diff --git a/tools/bufr_split_by_rdbSubtype.c b/tools/bufr_split_by_rdbSubtype.c index 253a109e7..0b74daa8f 100644 --- a/tools/bufr_split_by_rdbSubtype.c +++ b/tools/bufr_split_by_rdbSubtype.c @@ -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; diff --git a/tools/codes_count.c b/tools/codes_count.c index 3b09553f3..67a61db02 100644 --- a/tools/codes_count.c +++ b/tools/codes_count.c @@ -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); diff --git a/tools/codes_split_file.c b/tools/codes_split_file.c index daa9879de..8b2973379 100644 --- a/tools/codes_split_file.c +++ b/tools/codes_split_file.c @@ -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;