diff options
Diffstat (limited to 'newlib/libc/stdlib/mbrlen.c')
-rw-r--r-- | newlib/libc/stdlib/mbrlen.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/newlib/libc/stdlib/mbrlen.c b/newlib/libc/stdlib/mbrlen.c index ac9aa32..4319875 100644 --- a/newlib/libc/stdlib/mbrlen.c +++ b/newlib/libc/stdlib/mbrlen.c @@ -11,8 +11,10 @@ mbrlen(const char *s, size_t n, mbstate_t *ps) #ifdef _MB_CAPABLE if (ps == NULL) { - _REENT_CHECK_MISC(_REENT); - ps = &(_REENT_MBRLEN_STATE(_REENT)); + struct _reent *reent = _REENT; + + _REENT_CHECK_MISC(reent); + ps = &(_REENT_MBRLEN_STATE(reent)); } #endif |