diff --git a/examples/F90/codes_dump.f90 b/examples/F90/codes_dump.f90 index 97b2e7a3c..7c09fb24e 100644 --- a/examples/F90/codes_dump.f90 +++ b/examples/F90/codes_dump.f90 @@ -13,7 +13,7 @@ program grib_dump_test integer :: ifile, iret, msgid integer :: product_kind character(len=10) :: product_string - character(len=100) :: infile_name + character(len=512) :: infile_name call getarg(1, product_string) product_kind = CODES_PRODUCT_GRIB diff --git a/examples/F90/codes_dump.sh b/examples/F90/codes_dump.sh index b778154bf..cdf9d4897 100755 --- a/examples/F90/codes_dump.sh +++ b/examples/F90/codes_dump.sh @@ -9,5 +9,6 @@ . ./include.ctest.sh -${examples_dir}/eccodes_f_codes_dump grib ${data_dir}/sample.grib2 -${examples_dir}/eccodes_f_codes_dump bufr ${data_dir}/bufr/airs_57.bufr +cd $data_dir +${examples_dir}/eccodes_f_codes_dump grib sample.grib2 +${examples_dir}/eccodes_f_codes_dump bufr bufr/airs_57.bufr diff --git a/src/grib_accessor_class_gen.cc b/src/grib_accessor_class_gen.cc index b8a376b75..bd7341160 100644 --- a/src/grib_accessor_class_gen.cc +++ b/src/grib_accessor_class_gen.cc @@ -356,12 +356,12 @@ static int unpack_float(grib_accessor* a, float* v, size_t* len) static int unpack_string(grib_accessor* a, char* v, size_t* len) { - //int err = 0; + int err = 0; if (a->cclass->unpack_double && a->cclass->unpack_double != &unpack_double) { double val = 0.0; size_t l = 1; - grib_unpack_double(a, &val, &l); // TODO(masn): check return value - //if (err) return err; + err = grib_unpack_double(a, &val, &l); + if (err) return err; snprintf(v, 64, "%g", val); *len = strlen(v); grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to string", a->name); @@ -371,8 +371,8 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len) if (a->cclass->unpack_long && a->cclass->unpack_long != &unpack_long) { long val = 0; size_t l = 1; - grib_unpack_long(a, &val, &l); // TODO(masn): check return value - //if (err) return err; + err = grib_unpack_long(a, &val, &l); + if (err) return err; snprintf(v, 64, "%ld", val); *len = strlen(v); grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string\n", a->name);