X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..2650fa9ee9806a25904566dea091b1225d74f063:/stdlib/FreeBSD/strtoull.c diff --git a/stdlib/FreeBSD/strtoull.c b/stdlib/FreeBSD/strtoull.c index 38d6194..8f2fd94 100644 --- a/stdlib/FreeBSD/strtoull.c +++ b/stdlib/FreeBSD/strtoull.c @@ -33,6 +33,8 @@ static char sccsid[] = "@(#)strtouq.c 8.1 (Berkeley) 6/4/93"; #include __FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoull.c,v 1.21 2007/01/09 00:28:10 imp Exp $"); +#include "xlocale_private.h" + #include #include #include @@ -45,7 +47,8 @@ __FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoull.c,v 1.21 2007/01/09 00:28:10 im * alphabets and digits are each contiguous. */ unsigned long long -strtoull(const char * __restrict nptr, char ** __restrict endptr, int base) +strtoull_l(const char * __restrict nptr, char ** __restrict endptr, int base, + locale_t loc) { const char *s; unsigned long long acc; @@ -53,13 +56,14 @@ strtoull(const char * __restrict nptr, char ** __restrict endptr, int base) unsigned long long cutoff; int neg, any, cutlim; + NORMALIZE_LOCALE(loc); /* * See strtoq for comments as to the logic used. */ s = nptr; do { c = *s++; - } while (isspace((unsigned char)c)); + } while (isspace_l((unsigned char)c, loc)); if (c == '-') { neg = 1; c = *s++; @@ -116,3 +120,9 @@ noconv: *endptr = (char *)(any ? s - 1 : nptr); return (acc); } + +unsigned long long +strtoull(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + return strtoull_l(nptr, endptr, base, __current_locale()); +}