diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index e9b38785b..d1c4f6074 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -1279,9 +1279,8 @@ static int compare_all_dump_keys(grib_handle* handle1, grib_handle* handle2, gri } } iter = grib_keys_iterator_new(handle1, 0, NULL); - if (!iter) { - grib_context_log(context, GRIB_LOG_ERROR, "unable to create keys iterator"); + grib_context_log(context, GRIB_LOG_ERROR, "unable to create the BUFR keys iterator"); exit(1); } diff --git a/tools/grib_compare.c b/tools/grib_compare.c index 99145169a..92ebea613 100644 --- a/tools/grib_compare.c +++ b/tools/grib_compare.c @@ -1136,6 +1136,7 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option int i = 0; const char* name = NULL; grib_keys_iterator* iter = NULL; + grib_context* context = handle1->context; /* mask only if no -c option or headerMode (-H)*/ if (blocklist && (!listFromCommandLine || headerMode)) { @@ -1172,7 +1173,7 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option iter = grib_keys_iterator_new(h11, GRIB_KEYS_ITERATOR_SKIP_COMPUTED, NULL); if (!iter) { - printf("ERROR: unable to get keys iterator\n"); + grib_context_log(context, GRIB_LOG_ERROR, "unable to create the GRIB keys iterator"); exit(1); }