diff --git a/examples/C/bufr_subset.c b/examples/C/bufr_subset.c index e1676188f..d2ff95942 100644 --- a/examples/C/bufr_subset.c +++ b/examples/C/bufr_subset.c @@ -63,7 +63,7 @@ int main(int argc, char* argv[]) snprintf(key, sizeof(key), "/subsetNumber=%d/blockNumber", i); CODES_CHECK(codes_get_native_type(h, key, &ktype), 0); - //printf("Type = %d\n", ktype); + /* printf("Type = %d\n", ktype); */ printf(" subsetNumber=%d", i); /* read and print some data values */ diff --git a/examples/C/new_sample.c b/examples/C/new_sample.c index 53014845c..9560e3924 100644 --- a/examples/C/new_sample.c +++ b/examples/C/new_sample.c @@ -26,6 +26,9 @@ int main(int argc, char** argv) } /* h = codes_grib_handle_new_from_samples(NULL, "GRIB2"); */ + h = codes_handle_new_from_samples(NULL, "just a test"); + if (h) return 1; + h = codes_handle_new_from_samples(NULL, "GRIB2"); if (!h) { fprintf(stderr, "Cannot create grib handle\n"); diff --git a/src/grib_handle.cc b/src/grib_handle.cc index e2dd6ec7c..328502c29 100644 --- a/src/grib_handle.cc +++ b/src/grib_handle.cc @@ -229,12 +229,13 @@ grib_handle* codes_handle_new_from_samples(grib_context* c, const char* name) } g = codes_external_template(c, PRODUCT_ANY, name); - if (!g) + if (!g) { grib_context_log(c, GRIB_LOG_ERROR, "Unable to load sample file '%s.tmpl'\n" " from %s\n" " (ecCodes Version=%s)", name, c->grib_samples_path, ECCODES_VERSION_STR); + } return g; } @@ -514,7 +515,7 @@ grib_handle* grib_handle_new_from_partial_message_copy(grib_context* c, const vo memcpy(copy, data, size); - g = grib_handle_new_from_partial_message(c, copy, size); + g = grib_handle_new_from_partial_message(c, copy, size); g->buffer->property = CODES_MY_BUFFER; return g;