[Freeipa-devel] fixes to regressions in INI code and some improvements based on review

Simo Sorce ssorce at redhat.com
Thu Apr 9 00:06:10 UTC 2009


On Wed, 2009-04-08 at 17:35 -0400, Dmitri Pal wrote:
> +        /* Advance to the next valid number */
> +        for (str = endptr; *str; str++) {
> +            if (isdigit(*str) || (*str == '-') || (*str == '+') ||
> +               /* It is ok to do this since the string is null
> terminated */
> +               ((*str == '.') && isdigit(str[1]))) break;

NACK, if you use strtod() then you are assuming the values in the
configuration files are locale-dependent (whether this is a good idea is
another matter).
In this case you can't simply check for '.' as that is not the separator
in all locales, and would lead to different (wrong) behaviors in locales
where it isn't.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York




More information about the Freeipa-devel mailing list