Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2003-12-05 04:42:26 +0300
committerJeff Johnston <jjohnstn@redhat.com>2003-12-05 04:42:26 +0300
commit5d109bdeb0f5e0b6790296994e2ebb0c02303046 (patch)
treee938dc19333ab73f0de6c54dba9f5a1d8253087b /newlib/libc/stdio/vfprintf.c
parent3aca088831db311523415d156bbaafee3d9ec6f2 (diff)
2003-12-04 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* libc/stdio/vfprintf.c (_VFPRINTF_R): Use _r versions of mb routines for %lc and %ls support. * libc/stdio/vfscanf.c (_svfscanf_r): Add %lc, %C, %ls, and %S support. Remove CYGNUS_NEC markers and code within.
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';