X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/5f4d86c1219d56604890d932a3152b3b5dd15b55..34e8f8296870d0e8695f90e1a54240a589d41312:/locale/wcstof-fbsd.c diff --git a/locale/wcstof-fbsd.c b/locale/wcstof-fbsd.c index df38723..f2a6373 100644 --- a/locale/wcstof-fbsd.c +++ b/locale/wcstof-fbsd.c @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD: src/lib/libc/locale/wcstof.c,v 1.3 2004/04/07 09:47:56 tjr E /* * 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); + float wcstof_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, locale_t loc) @@ -76,7 +79,7 @@ wcstof_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, val = strtof_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);