X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..5f1254882f242514d4ceaf1ecebb140dcc2a511d:/stdlib/FreeBSD/strtoumax.c diff --git a/stdlib/FreeBSD/strtoumax.c b/stdlib/FreeBSD/strtoumax.c index f592063..22400a5 100644 --- a/stdlib/FreeBSD/strtoumax.c +++ b/stdlib/FreeBSD/strtoumax.c @@ -33,6 +33,8 @@ static char sccsid[] = "from @(#)strtoul.c 8.1 (Berkeley) 6/4/93"; #include __FBSDID("$FreeBSD: src/lib/libc/stdlib/strtoumax.c,v 1.11 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/strtoumax.c,v 1.11 2007/01/09 00:28:10 i * alphabets and digits are each contiguous. */ uintmax_t -strtoumax(const char * __restrict nptr, char ** __restrict endptr, int base) +strtoumax_l(const char * __restrict nptr, char ** __restrict endptr, int base, + locale_t loc) { const char *s; uintmax_t acc; @@ -53,13 +56,14 @@ strtoumax(const char * __restrict nptr, char ** __restrict endptr, int base) uintmax_t cutoff; int neg, any, cutlim; + NORMALIZE_LOCALE(loc); /* * See strtoimax 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); } + +uintmax_t +strtoumax(const char * __restrict nptr, char ** __restrict endptr, int base) +{ + return strtoumax_l(nptr, endptr, base, __current_locale()); +}