]> Pileus Git - ~andy/rsl/blobdiff - src/histogram.c
Open files in binary mode for Win32
[~andy/rsl] / src / histogram.c
index ffefe1e1b22284ff3b9918a335e3e04249c1b383..5acc7f147407dd8df82a29716bba0cad22494b54 100644 (file)
@@ -107,7 +107,7 @@ void RSL_print_histogram(Histogram *histogram, int min_range, int max_range,
        }
 
     if (radar_verbose_flag) fprintf(stderr,"print_histogram: %s\n",filename);
-       if((fp = fopen(filename,"w")) == NULL ) {
+       if((fp = fopen(filename,"wb")) == NULL ) {
                perror(filename);
                return;
     }
@@ -156,7 +156,7 @@ Histogram *RSL_read_histogram(char *infile)
   int nbins;
   Histogram *histogram;
 
-  if ((fp = fopen(infile, "r")) == NULL) {
+  if ((fp = fopen(infile, "rb")) == NULL) {
        perror(infile);
        return NULL;
   }
@@ -191,7 +191,7 @@ int RSL_write_histogram(Histogram *histogram, char *outfile)
   FILE *fp;
   int n;
 
-  if ((fp = fopen(outfile, "w")) == NULL) {
+  if ((fp = fopen(outfile, "wb")) == NULL) {
        perror(outfile);
        return -1;
   }