Parse: better converting function in string_to_opt

This commit is contained in:
Philippe Pepiot 2010-04-15 02:22:44 +02:00
parent 18b702c112
commit aca9e78491

View File

@ -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"))