diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-05-08 19:38:33 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-05-08 19:38:33 +0000 |
commit | 0e6edb13c6bf63f5122459b30793a7dc3c00c1e6 (patch) | |
tree | 4a1402db24cfd18d510f8952d55f7eeaf9b96534 /winsup | |
parent | 415867c378925543e804afc6a4155a571276751d (diff) | |
download | newlib-0e6edb13c6bf63f5122459b30793a7dc3c00c1e6.zip newlib-0e6edb13c6bf63f5122459b30793a7dc3c00c1e6.tar.gz newlib-0e6edb13c6bf63f5122459b30793a7dc3c00c1e6.tar.bz2 |
* strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting
wide char to SO/UTF-8 sequence.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/strfuncs.cc | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 74ca188..b887f42 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-05-08 IWAMURO Motonori <deenheart@gmail.com> + + * strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting + wide char to SO/UTF-8 sequence. + 2009-05-08 Corinna Vinschen <corinna@vinschen.de> * include/sys/select.h: Guard definitions with __USE_W32_SOCKETS as diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc index 110fe8f..75ca3db 100644 --- a/winsup/cygwin/strfuncs.cc +++ b/winsup/cygwin/strfuncs.cc @@ -432,6 +432,7 @@ sys_cp_wcstombs (wctomb_p f_wctomb, char *charset, char *dst, size_t len, ASCII SO; UTF-8 representation of invalid char. */ if (bytes == -1 && *charset != 'U'/*TF-8*/) { + _REENT->_errno = 0; buf[0] = 0x0e; /* ASCII SO */ bytes = __utf8_wctomb (_REENT, buf + 1, pw, charset, &ps); if (bytes == -1) |