]> git.saurik.com Git - apple/libc.git/blobdiff - locale/FreeBSD/wcstof.c.patch
Libc-583.tar.gz
[apple/libc.git] / locale / FreeBSD / wcstof.c.patch
index 2cbf6d94c8eb1dffad168c7770a55ef1265259ce..ffc6ef625f0b98c3cf10b01d5132ac5c9a6201b9 100644 (file)
@@ -1,6 +1,6 @@
---- wcstof.c.orig      2007-03-16 01:15:20.000000000 -0700
-+++ wcstof.c   2007-03-16 03:04:01.000000000 -0700
-@@ -27,44 +27,64 @@
+--- wcstof.c.orig      2008-10-09 11:50:52.000000000 -0700
++++ wcstof.c   2008-10-29 00:51:43.000000000 -0700
+@@ -27,44 +27,67 @@
  #include <sys/cdefs.h>
  __FBSDID("$FreeBSD: src/lib/libc/locale/wcstof.c,v 1.3 2004/04/07 09:47:56 tjr Exp $");
  
@@ -14,6 +14,9 @@
  /*
   * 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(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr)
 +wcstof_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
@@ -67,7 +70,7 @@
  
        if (endptr != NULL)
 -              *endptr = (wchar_t *)nptr + (end - buf);
-+              *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));
  
 -      free(buf);
 +      _simple_sfree(b);