From 9e52edd4a31e07ea4ef15c16f2adcd3439366584 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 21 Mar 2021 17:27:14 +0000 Subject: [PATCH] Examples: print error rather than assert --- examples/C/bufr_missing.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/C/bufr_missing.c b/examples/C/bufr_missing.c index 3779b9753..da968b11a 100644 --- a/examples/C/bufr_missing.c +++ b/examples/C/bufr_missing.c @@ -62,8 +62,10 @@ int main(int argc, char* argv[]) } is_missing = codes_is_missing(h, "relativeHumidity", &err); - assert(!err); - assert(is_missing == 1); + if (err || !is_missing) { + fprintf(stderr, "Error: relativeHumidity should be 'missing'\n"); + return 1; + } /* Set some other keys to be missing */ CODES_CHECK(codes_set_missing(h, "blockNumber"), 0);