Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:ecmwf/eccodes into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed May 2, 2024
2 parents c04bc4f + 607f15b commit 99feb86
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/grib2ppm.cc
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ int main(int argc, char* argv[])
continue;
}

f = fopen(argv[i], "r");
f = fopen(argv[i], "rb");
if (!f) {
perror(argv[i]);
exit(1);
@@ -226,7 +226,9 @@ int main(int argc, char* argv[])
if (v > ucap) {
v = ucap;
}
c = (v - min) * 65535 / (max - min);
double denom = 1;
if (max != min) denom = max - min;
c = (v - min) * 65535 / denom;
hh = c >> 8;
l = c & 0xff;
printf("%c", hh);

0 comments on commit 99feb86

Please sign in to comment.