+2009-05-08 Corinna Vinschen <corinna@vinschen.de>
+ IWAMURO Motonori <deenheart@gmail.com>
+
+ * strfuncs.cc (sys_cp_wcstombs): save and restore previous errno value.
+ (sys_cp_mbstowcs): Ditto.
+
2009-05-08 IWAMURO Motonori <deenheart@gmail.com>
* strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting
wchar_t *pwcs = (wchar_t *) src;
size_t n = 0;
mbstate_t ps;
+ save_errno save;
memset (&ps, 0, sizeof ps);
if (dst == NULL)
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)
size_t len = dlen;
int bytes;
mbstate_t ps;
+ save_errno save;
memset (&ps, 0, sizeof ps);
if (dst == NULL)