X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/224c70764cab4e0e39a26aaf3ad3016552f62f55..7b00c0c43f52e9d27168e67a26aac19065cdb40c:/locale/wcstold-fbsd.c diff --git a/locale/wcstold-fbsd.c b/locale/wcstold-fbsd.c index cf73555..45222d8 100644 --- a/locale/wcstold-fbsd.c +++ b/locale/wcstold-fbsd.c @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD: src/lib/libc/locale/wcstold.c,v 1.4 2004/04/07 09:47:56 tjr /* * See wcstod() for comments as to the logic used. */ + +extern size_t __wcs_end_offset(const char * __restrict buf, const char * __restrict end, locale_t loc); + long double wcstold_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, locale_t loc) @@ -76,7 +79,7 @@ wcstold_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, val = strtold_l(buf, &end, loc); if (endptr != NULL) - *endptr = (end == buf) ? (wchar_t *)nptr0 : ((wchar_t *)first + (end - buf)); + *endptr = (end == buf) ? (wchar_t *)nptr0 : ((wchar_t *)first + __wcs_end_offset(buf, end, loc)); _simple_sfree(b);