commit a325dba13f4afdcb5707263faee14111626d943a
parent 6db0623d320ae7decb5a6c0141abcf93f6b8125f
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 8 Oct 2025 12:42:44 +0200
Correction of argument analysis in the scem utility
The analysis of the date and location was incorrect. The expected date
format was not the one documented, and the longitude was initialized
from the latitude.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/scem_main.c b/src/scem_main.c
@@ -68,7 +68,7 @@ parse_date(const char* str, struct tm* time)
{
ASSERT(str && time);
- if(!strptime(str, "%Y-%m-%dT%H:%M%S\n", time)) {
+ if(!strptime(str, "%Y-%m-%dT%H:%M:%S\n", time)) {
return RES_BAD_ARG;
} else {
return RES_OK;
@@ -140,9 +140,9 @@ args_init(struct args* args, int argc, char** argv)
/* Is location missing? */
if(argc - optind < 2) { res = RES_BAD_ARG; goto error; }
- res = parse_dbl(argv[optind], -90, 90, &args->pos.latitude);
+ res = parse_dbl(argv[optind+0], -90, 90, &args->pos.latitude);
if(res != RES_OK) goto error;
- res = parse_dbl(argv[optind], -180, 180, &args->pos.longitude);
+ res = parse_dbl(argv[optind+1], -180, 180, &args->pos.longitude);
if(res != RES_OK) goto error;
exit:
return res;