]> git.saurik.com Git - apple/libc.git/blobdiff - locale/wcstold-fbsd.c
Libc-763.13.tar.gz
[apple/libc.git] / locale / wcstold-fbsd.c
index cf735558e74de4c6183b4bc8655b71d25174a99a..45222d8c5ba6deccfc5a814f1d687625f042295f 100644 (file)
@@ -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);