diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-12-19 18:50:00 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-12-19 18:50:00 +0000 |
commit | 281924766d145019dc558e21aba60de3cd298e3d (patch) | |
tree | 68a3813fe86fe628b97d04862df52bd64b36c549 | |
parent | 0fcafd15354f06bf7621ec09dd7f47e53767bac0 (diff) | |
download | cygnal-281924766d145019dc558e21aba60de3cd298e3d.tar.gz cygnal-281924766d145019dc558e21aba60de3cd298e3d.tar.bz2 cygnal-281924766d145019dc558e21aba60de3cd298e3d.zip |
* libc/stdio/vfwscanf.c (__SVFWSCANF_R): Fix fetching decimal_point in
!_MB_CAPABLE as well as in !__HAVE_LOCALE_INFO_EXTENDED__ case.
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/stdio/vfwscanf.c | 11 |
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 */ |