mirror of https://github.com/ecmwf/eccodes.git
Add guards for grib_is_missing_string
This commit is contained in:
parent
e337247173
commit
b26d806ea2
|
@ -603,7 +603,7 @@ static int get_native_type(grib_accessor* a)
|
|||
{
|
||||
grib_accessor_bufr_data_element* self = (grib_accessor_bufr_data_element*)a;
|
||||
int ret = GRIB_TYPE_DOUBLE;
|
||||
|
||||
DebugAssert(self);
|
||||
switch (self->type) {
|
||||
case BUFR_DESCRIPTOR_TYPE_STRING:
|
||||
ret = GRIB_TYPE_STRING;
|
||||
|
|
|
@ -314,6 +314,7 @@ int grib_accessors_list_print(grib_handle* h, grib_accessors_list* al, const cha
|
|||
char long_format[] = "%ld"; /* default format for printing integer keys */
|
||||
char default_separator[] = " ";
|
||||
grib_accessor* a = al->accessor;
|
||||
DebugAssert(a);
|
||||
|
||||
/* Number of columns specified as 0 means print on ONE line i.e. num cols = infinity */
|
||||
if (maxcols == 0)
|
||||
|
|
|
@ -599,7 +599,9 @@ int grib_is_missing_string(grib_accessor* a, unsigned char* x, size_t len)
|
|||
}
|
||||
}
|
||||
|
||||
ret = (a == NULL || ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) && ret == 1)) ? 1 : 0;
|
||||
if (!a) return ret;
|
||||
|
||||
ret = ( ((a->flags & GRIB_ACCESSOR_FLAG_CAN_BE_MISSING) && ret == 1) ) ? 1 : 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue