mirror of https://github.com/ecmwf/eccodes.git
Fortran: any_f_scan_file_ check for errors
This commit is contained in:
parent
4047c5764c
commit
4cd68b210f
|
@ -1468,7 +1468,14 @@ int any_f_new_from_scanned_file_(int* fid,int* msgid,int* gid)
|
|||
int err = 0;
|
||||
FILE* f = get_file(*fid);
|
||||
|
||||
/* fortran convention of 1 based index*/
|
||||
if (info_messages == NULL) {
|
||||
return GRIB_INVALID_ARGUMENT;
|
||||
}
|
||||
if (*msgid < 1 || *msgid > info_messages->n) {
|
||||
return GRIB_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
/* fortran convention of 1-based index */
|
||||
const int n = *msgid - 1;
|
||||
|
||||
l_message_info* msg=(l_message_info*)grib_oarray_get(info_messages, n);
|
||||
|
|
Loading…
Reference in New Issue