From aca9e7849163d032b0b5baf8fdb4867bbf43d2b8 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Thu, 15 Apr 2010 02:22:44 +0200 Subject: [PATCH] Parse: better converting function in string_to_opt --- src/parse/parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse/parse.c b/src/parse/parse.c index 8e1bc14..ba391a0 100644 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -581,8 +581,8 @@ string_to_opt(char *s) if (!s || !strlen(s)) return ret; - ret.num = atoi(s); - sscanf(s, "%f", &ret.fnum); + ret.num = strtol(s, (char**)NULL, 10); + ret.fnum = strtod(s, NULL); if (!strcmp(s, "true") || !strcmp(s, "True") || !strcmp(s, "TRUE") || !strcmp(s, "1"))