Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-12-19 22:50:00 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-12-19 22:50:00 +0400
commit281924766d145019dc558e21aba60de3cd298e3d (patch)
tree68a3813fe86fe628b97d04862df52bd64b36c549 /newlib
parent0fcafd15354f06bf7621ec09dd7f47e53767bac0 (diff)
* libc/stdio/vfwscanf.c (__SVFWSCANF_R): Fix fetching decimal_point in
!_MB_CAPABLE as well as in !__HAVE_LOCALE_INFO_EXTENDED__ case.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/stdio/vfwscanf.c11
2 files changed, 11 insertions, 5 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 9798aea55..c334de9a1 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-19 Corinna Vinschen <vinschen@redhat.com>
+
+ * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Fix fetching decimal_point in
+ !_MB_CAPABLE as well as in !__HAVE_LOCALE_INFO_EXTENDED__ case.
+
2013-12-18 Corinna Vinschen <vinschen@redhat.com>
* libc/stdio/vfscanf.c (BUF): Change definition to take multibyte
diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c
index 731197a1c..263d8f23d 100644
--- a/newlib/libc/stdio/vfwscanf.c
+++ b/newlib/libc/stdio/vfwscanf.c
@@ -161,6 +161,7 @@ C99, POSIX-1.2008
#ifdef FLOATING_POINT
#include <math.h>
#include <float.h>
+#include <locale.h>
#ifdef __HAVE_LOCALE_INFO_EXTENDED__
#include "../locale/lnumeric.h"
#endif
@@ -452,16 +453,16 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap),
{
size_t nconv;
- memset (&state, '\0', sizeof (state));
- nconv = _mbrtowc_r (data, &decpt,
- _localeconv_r (data)->decimal_point,
- MB_CUR_MAX, &state);
+ memset (&mbs, '\0', sizeof (mbs));
+ nconv = _mbrtowc_r (rptr, &decpt,
+ _localeconv_r (rptr)->decimal_point,
+ MB_CUR_MAX, &mbs);
if (nconv == (size_t) -1 || nconv == (size_t) -2)
decpt = L'.';
}
#endif /* !__HAVE_LOCALE_INFO_EXTENDED__ */
#else
- decpt = (wchar_t) *_localeconv_r (data)->decimal_point;
+ decpt = (wchar_t) *_localeconv_r (rptr)->decimal_point;
#endif /* !_MB_CAPABLE */
#endif /* FLOATING_POINT */