]> Pileus Git - ~andy/rsl/blobdiff - src/read_write.c
Open files in binary mode for Win32
[~andy/rsl] / src / read_write.c
index 8c9398799b433d0c54dab4289cf0acf251309a30..65b378cd3b9fb132a22c2802b61847b09ba2c01e 100644 (file)
@@ -194,7 +194,7 @@ Radar *RSL_read_radar(char *infile)
   int nradar;
   char title[100];
 
-  if ((fp = fopen(infile, "r")) == NULL) {
+  if ((fp = fopen(infile, "rb")) == NULL) {
        perror(infile);
        return NULL;
   }
@@ -366,7 +366,7 @@ int RSL_write_radar(Radar *radar, char *outfile)
 
   if (radar == NULL) return 0;
   
-  if ((fp = fopen(outfile, "w")) == NULL) {
+  if ((fp = fopen(outfile, "wb")) == NULL) {
        perror(outfile);
        return -1;
   }
@@ -386,7 +386,7 @@ int RSL_write_radar_gzip(Radar *radar, char *outfile)
   int n;
   if (radar == NULL) return 0;
   
-  if ((fp = fopen(outfile, "w")) == NULL) {
+  if ((fp = fopen(outfile, "wb")) == NULL) {
        perror(outfile);
        return -1;
   }