correct convertion from non decimal base
authorLaurent Mazet <mazet@softndesign.org>
Tue, 26 Dec 2023 02:51:13 +0000 (03:51 +0100)
committerLaurent Mazet <mazet@softndesign.org>
Tue, 26 Dec 2023 02:51:13 +0000 (03:51 +0100)
parser.c

index 44152a96cc4cb1a5f3fd655642b49de0b863d51e..7880acfa156c049e13c778cc5c280faec0f3c412 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -290,7 +290,7 @@ element_t *parser (char *str, char **next, int prio)
 
         VERBOSE (DEBUG, fprintf (stdout, "start processing value\n"));
         char *pt;
-        double value = (get_ibase () == 10) ? strtod (str, &pt) : strtoul (str, &pt, get_ibase ());
+        double value = (get_ibase () == 10) ? strtod (str, &pt) : strtol (str, &pt, get_ibase ());
         VERBOSE (INFO, fprintf (stdout, "Value: %f\n", value));
         if (str != pt) {
             if ((root == NULL) || (root->prio == 6)) {