BUFR dump: Check error code before asserting

This commit is contained in:
Shahram Najm 2022-04-27 13:30:12 +01:00
parent bc74164ea9
commit cfaebc60bf
1 changed files with 6 additions and 1 deletions

View File

@ -484,7 +484,12 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
self->empty = 0;
err = grib_unpack_string(a, value, &size);
Assert(size < MAX_STRING_SIZE);
if (err) {
sprintf(value, " *** ERR=%d (%s) [dump_string on '%s']",
err, grib_get_error_message(err), a->name);
} else {
Assert(size < MAX_STRING_SIZE);
}
p = value;
if (grib_is_missing_string(a, (unsigned char*)value, size)) {
is_missing = 1;