X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..a28bf75d63c6a64e4c3b417c6052e45f42c6cedd:/stdlib/FreeBSD/atoi.c?ds=sidebyside diff --git a/stdlib/FreeBSD/atoi.c b/stdlib/FreeBSD/atoi.c index 38ab632..ac6fcca 100644 --- a/stdlib/FreeBSD/atoi.c +++ b/stdlib/FreeBSD/atoi.c @@ -33,11 +33,22 @@ static char sccsid[] = "@(#)atoi.c 8.1 (Berkeley) 6/4/93"; #include __FBSDID("$FreeBSD: src/lib/libc/stdlib/atoi.c,v 1.6 2007/01/09 00:28:09 imp Exp $"); +#include "xlocale_private.h" + #include int atoi(str) const char *str; { - return (int)strtol(str, (char **)NULL, 10); + return (int)strtol_l(str, (char **)NULL, 10, __current_locale()); +} + +int +atoi_l(str, loc) + const char *str; + locale_t loc; +{ + /* no need to call NORMALIZE_LOCALE(loc) because strtol_l will */ + return (int)strtol_l(str, (char **)NULL, 10, loc); }