From 8a52132b300f24f049556a90c91f179821322c69 Mon Sep 17 00:00:00 2001 From: Nathan Wendt Date: Mon, 3 Apr 2023 08:38:25 -0500 Subject: [PATCH] Another --- src/grib_api_version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grib_api_version.c b/src/grib_api_version.c index ae217a7..6d2b04f 100644 --- a/src/grib_api_version.c +++ b/src/grib_api_version.c @@ -18,7 +18,7 @@ SEXP gribr_api_version(void) { minor = (version - major * 10000) / 100; revision = (version - major * 10000) - (minor * 100); err = snprintf(string, slen, "%ld.%ld.%ld", major, minor, revision); - if (err) { + if (err >= slen || err < 0) { error("Problem getting ecCodes version."); }