mirror of https://github.com/ecmwf/eccodes.git
BUFR dump: Check error code before asserting
This commit is contained in:
parent
bc74164ea9
commit
cfaebc60bf
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue