mirror of https://github.com/ecmwf/eccodes.git
ECC-1002: Windows: encoding tests fail: 'maximum allowable value is 0'
This commit is contained in:
parent
9cb06b5ac6
commit
a0fbb239c5
|
@ -244,7 +244,7 @@ int pack_long_unsigned_helper(grib_accessor* a, const long* val, size_t *len, in
|
|||
}
|
||||
if (nbits < 33) {
|
||||
unsigned long maxval = (1UL << nbits)-1;
|
||||
if (v > maxval) {
|
||||
if (maxval > 0 && v > maxval) { /* See ECC-1002 */
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR,
|
||||
"Key \"%s\": Trying to encode value of %ld but the maximum allowable value is %ld (number of bits=%ld)\n",
|
||||
a->name, v, maxval, nbits);
|
||||
|
|
Loading…
Reference in New Issue