* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion of

non-ASCII chars on Cygwin.
	* libc/stdlib/wctomb_r.c (__ascii_wctomb): Ditto.
This commit is contained in:
Corinna Vinschen 2010-01-10 13:54:34 +00:00
parent f1817d368a
commit 2b77087a48
3 changed files with 26 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2010-01-10 Corinna Vinschen <corinna@vinschen.de>
* libc/stdlib/mbtowc_r.c (__ascii_mbtowc): Disallow conversion of
non-ASCII chars on Cygwin.
* libc/stdlib/wctomb_r.c (__ascii_wctomb): Ditto.
2009-12-22 Eric Blake <ebb9@byu.net> 2009-12-22 Eric Blake <ebb9@byu.net>
* libc/include/sys/unistd.h (suboptarg, getsubopt): Move... * libc/include/sys/unistd.h (suboptarg, getsubopt): Move...
@ -46,13 +52,13 @@
* libc/stdlib/atexit.c: Ditto. * libc/stdlib/atexit.c: Ditto.
* libc/stdlib/on_exit.c: Ditto. * libc/stdlib/on_exit.c: Ditto.
2009-12-17 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-12-17 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/include/machine/ieeefp.h: Rework __IEEE_*_ENDIAN handling. * libc/include/machine/ieeefp.h: Rework __IEEE_*_ENDIAN handling.
* libc/machine/arm/machine/endian.h: Remove (Conflicts with * libc/machine/arm/machine/endian.h: Remove (Conflicts with
libc/include/machine/endian.h) libc/include/machine/endian.h)
2009-12-17 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-12-17 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/include/machine/setjmp.h: Set up _JBLEN #ifdef __m68k__. * libc/include/machine/setjmp.h: Set up _JBLEN #ifdef __m68k__.
@ -74,11 +80,11 @@
and ETOOMANYREFS into general list as they are referenced and ETOOMANYREFS into general list as they are referenced
by OpenGroup and needed by RTEMS. by OpenGroup and needed by RTEMS.
2009-12-16 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-12-16 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/search/hcreate.c: Don't include <sys/queue.h> (Unused). * libc/search/hcreate.c: Don't include <sys/queue.h> (Unused).
2009-12-16 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-12-16 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/sys/rtems/machine/_types.h: New (Derived from * libc/sys/rtems/machine/_types.h: New (Derived from
machine/_default_types.h). machine/_default_types.h).
@ -366,16 +372,16 @@
* libc/locale/locale.c: Drop Cygwin-specific windows.h include. * libc/locale/locale.c: Drop Cygwin-specific windows.h include.
(loadlocale): Call __set_charset_from_codepage with 0 codepage. (loadlocale): Call __set_charset_from_codepage with 0 codepage.
2009-09-22 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-09-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/include/stdlib.h: Add posix_memalign. * libc/include/stdlib.h: Add posix_memalign.
2009-09-22 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-09-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.host (*-rtems*): Remove -DMISSING_SYSCALL_NAMES. * configure.host (*-rtems*): Remove -DMISSING_SYSCALL_NAMES.
Add -DHAVE_BLKSIZE, -D_NO_WORDEXP -D_NO_POPEN. Add -DHAVE_BLKSIZE, -D_NO_WORDEXP -D_NO_POPEN.
2009-09-22 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-09-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.host (m32c): Move setting -DABORT_PROVIDED to second * configure.host (m32c): Move setting -DABORT_PROVIDED to second
"case $host". "case $host".
@ -5453,7 +5459,7 @@
* libc/include/sys/unistd.h: Define all _SC_xxx values as * libc/include/sys/unistd.h: Define all _SC_xxx values as
required by SUSv3. Unify formatting. required by SUSv3. Unify formatting.
2007-02-02 Ralf Corsépius <ralf.corsepius@rtems.org> 2007-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/include/sys/errno.h: Add ECANCELED. * libc/include/sys/errno.h: Add ECANCELED.

View File

@ -47,6 +47,14 @@ _DEFUN (__ascii_mbtowc, (r, pwc, s, n, charset, state),
if (n == 0) if (n == 0)
return -2; return -2;
#ifdef __CYGWIN__
if ((wchar_t)*t >= 0x80)
{
r->_errno = EILSEQ;
return -1;
}
#endif
*pwc = (wchar_t)*t; *pwc = (wchar_t)*t;
if (*t == '\0') if (*t == '\0')

View File

@ -40,7 +40,11 @@ _DEFUN (__ascii_wctomb, (r, s, wchar, charset, state),
if (s == NULL) if (s == NULL)
return 0; return 0;
#ifdef __CYGWIN__
if ((size_t)wchar >= 0x80)
#else
if ((size_t)wchar >= 0x100) if ((size_t)wchar >= 0x100)
#endif
{ {
r->_errno = EILSEQ; r->_errno = EILSEQ;
return -1; return -1;