diff options
Diffstat (limited to 'newlib/libc/stdlib/wctomb.c')
-rw-r--r-- | newlib/libc/stdlib/wctomb.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/newlib/libc/stdlib/wctomb.c b/newlib/libc/stdlib/wctomb.c index 9e82eaaba..8d4ceb8ad 100644 --- a/newlib/libc/stdlib/wctomb.c +++ b/newlib/libc/stdlib/wctomb.c @@ -57,10 +57,12 @@ _DEFUN (wctomb, (s, wchar), wchar_t wchar) { #ifdef _MB_CAPABLE - _REENT_CHECK_MISC(_REENT); + struct _reent *reent = _REENT; - return __wctomb (_REENT, s, wchar, __locale_charset (), - &(_REENT_WCTOMB_STATE(_REENT))); + _REENT_CHECK_MISC(reent); + + return __wctomb (reent, s, wchar, __locale_charset (), + &(_REENT_WCTOMB_STATE(reent))); #else /* not _MB_CAPABLE */ if (s == NULL) return 0; |