summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/vfprintf.c')
-rw-r--r--newlib/libc/stdio/vfprintf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index 743d307a8..7015740e0 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -750,7 +750,7 @@ reswitch: switch (ch) {
mbstate_t ps;
memset((void *)&ps, '\0', sizeof(mbstate_t));
- if ((size = (int)wcrtomb(cp,
+ if ((size = (int)_wcrtomb_r(data, cp,
(wchar_t)GET_ARG(N, ap, wint_t),
&ps)) == -1)
goto error;
@@ -931,8 +931,8 @@ reswitch: switch (ch) {
while (1) {
if (wcp[m] == L'\0')
break;
- if ((n = (int)wcrtomb(buf,
- wcp[m], &ps)) == -1)
+ if ((n = (int)_wcrtomb_r(data,
+ buf, wcp[m], &ps)) == -1)
goto error;
if (n + size > prec)
break;
@@ -943,8 +943,8 @@ reswitch: switch (ch) {
}
}
else {
- if ((size = (int)wcsrtombs(NULL, &wcp,
- 0, &ps)) == -1)
+ if ((size = (int)_wcsrtombs_r(data,
+ NULL, &wcp, 0, &ps)) == -1)
goto error;
wcp = (_CONST wchar_t *)cp;
}
@@ -953,13 +953,13 @@ reswitch: switch (ch) {
break;
if ((malloc_buf =
- (char *)malloc(size + 1)) == NULL)
+ (char *)_malloc_r(data, size + 1)) == NULL)
goto error;
/* Convert widechar string to multibyte string. */
memset((void *)&ps, '\0', sizeof(mbstate_t));
- if (wcsrtombs(malloc_buf, &wcp, size, &ps)
- != size)
+ if (_wcsrtombs_r(data, malloc_buf,
+ &wcp, size, &ps) != size)
goto error;
cp = malloc_buf;
cp[size] = '\0';