From 5d109bdeb0f5e0b6790296994e2ebb0c02303046 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 5 Dec 2003 01:42:26 +0000 Subject: 2003-12-04 Artem B. Bityuckiy * 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. --- newlib/libc/stdio/vfprintf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'newlib/libc/stdio/vfprintf.c') 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'; -- cgit v1.2.3