From 2b78c792406a095bf07db745cd2c79f62acad484 Mon Sep 17 00:00:00 2001 From: Mazet Laurent Date: Wed, 26 Nov 2025 11:59:15 +0100 Subject: [PATCH] enhance parser --- parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index e9063de..c9d535a 100644 --- a/parse.c +++ b/parse.c @@ -24,7 +24,7 @@ int parse_int (char *str) { char *pt = NULL; int val = strtol (str, &pt, 0); - if ((*pt != '\0') && (*pt != ' ') && (*pt != '\t')) { + if ((*pt != '\0') && (*pt != '\n') && (*pt != ' ') && (*pt != '\t')) { VERBOSE (morep, WARNING, PRINTF ("can't parse '%s' as integer\n", str)); } return val; @@ -34,7 +34,7 @@ double parse_double (char *str) { char *pt = NULL; double val = strtod (str, &pt); - if ((*pt != '\0') && (*pt != ' ') && (*pt != '\t')) { + if ((*pt != '\0') && (*pt != '\n') && (*pt != ' ') && (*pt != '\t')) { VERBOSE (morep, WARNING, PRINTF ("can't parse '%s' as double\n", str)); } return val; -- 2.30.2