commit c6bbfcce1014f8d1430ac95b65222d588c0f252c
parent 9da198754f1d05bc876411464b4a8cca37866dfe
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Fri, 5 Jun 2026 18:31:25 +0200
Improve error logs of the scem app
Output a meaningful message if latitude or longitude user imput is out
of bounds
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/scem_main.c b/src/scem_main.c
@@ -89,7 +89,10 @@ parse_dbl
ASSERT(str && out_dbl && min <= max);
if((res = cstr_to_double(str, &dbl)) != RES_OK) return res;
- if(dbl < min || dbl > max) return RES_BAD_ARG;
+ if(dbl < min || dbl > max) {
+ fprintf(stderr, "scem: value not in range: %g [%g %g]\n", dbl, min, max);
+ return RES_BAD_ARG;
+ }
*out_dbl = dbl;
return RES_OK;