mirror of https://github.com/ecmwf/eccodes.git
Tools: Fix for Windows and constant fields
This commit is contained in:
parent
e06656c673
commit
607f15bbdc
|
@ -122,7 +122,7 @@ int main(int argc, char* argv[])
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
f = fopen(argv[i], "r");
|
f = fopen(argv[i], "rb");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
perror(argv[i]);
|
perror(argv[i]);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -226,7 +226,9 @@ int main(int argc, char* argv[])
|
||||||
if (v > ucap) {
|
if (v > ucap) {
|
||||||
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;
|
hh = c >> 8;
|
||||||
l = c & 0xff;
|
l = c & 0xff;
|
||||||
printf("%c", hh);
|
printf("%c", hh);
|
||||||
|
|
Loading…
Reference in New Issue