GRIB-952: grib_set -r repacks values despite errors in setting the keys

This commit is contained in:
Shahram Najm 2016-03-22 16:30:35 +00:00
parent b3da880512
commit 21bd5008d5
1 changed files with 6 additions and 2 deletions

View File

@ -120,8 +120,10 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
GRIB_CHECK_NOLINE(grib_get_double_array(h,"values",v,&size),0);
}
if (options->set_values_count != 0)
if (options->set_values_count != 0) {
err=grib_set_values(h,options->set_values,options->set_values_count);
if( err != GRIB_SUCCESS && options->fail) exit(err);
}
if ( options->repack ) {
@ -136,7 +138,9 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
}
#endif
if (err == GRIB_SUCCESS) {
GRIB_CHECK_NOLINE(grib_set_double_array(h,"values",v,size),0);
}
free(v);
}