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:
authorCorinna Vinschen <corinna@vinschen.de>2010-01-14 15:48:58 +0300
committerCorinna Vinschen <corinna@vinschen.de>2010-01-14 15:48:58 +0300
commit0b82c17d579ed23fedea73dc6b9d1f52ac48ea48 (patch)
treebf879647de6d3f39459ea3b7328dd97e676fde82 /newlib/libc/stdio/vfprintf.c
parent811de4bff30b41fdddb99be25cd3d41d039e2919 (diff)
* libc/stdio/vfprintf.c (_VFPRINTF_R): Just wave bytes invalid in
the current charset through.
Diffstat (limited to 'newlib/libc/stdio/vfprintf.c')
-rw-r--r--newlib/libc/stdio/vfprintf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index 773485885..fc33c3027 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -724,8 +724,13 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap),
cp = fmt;
#ifdef _MB_CAPABLE
while ((n = __mbtowc (data, &wc, fmt, MB_CUR_MAX,
- __locale_charset (), &state)) > 0) {
- if (wc == '%')
+ __locale_charset (), &state)) != 0) {
+ if (n < 0) {
+ /* Wave invalid chars through. */
+ memset (&state, 0, sizeof state);
+ n = 1;
+ }
+ else if (wc == '%')
break;
fmt += n;
}