Commit in reactos/lib/msvcrt/stdio on MAIN
vfprintf.c+14-31.17 -> 1.18
Handle invalid Unicode strings for %S format like MS does

reactos/lib/msvcrt/stdio
vfprintf.c 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- vfprintf.c	10 Jan 2004 14:22:14 -0000	1.17
+++ vfprintf.c	19 Mar 2004 23:00:35 -0000	1.18
@@ -679,9 +679,20 @@
 		}
 	for (i = 0; i < len; ++i)
 	{
-		if (putc((unsigned char)(*sw++), f) == EOF)
-			return -1;
-		done++;
+#define MB_CUR_MAX 1
+		char mb[MB_CUR_MAX];
+		int mbcount, j;
+		mbcount = wctomb(mb, *sw++);
+		if (mbcount <= 0)
+		{
+			break;
+		}
+		for (j = 0; j < mbcount; j++)
+		{
+			if (putc(mb[j], f) == EOF)
+				return -1;
+			done++;
+		}
 	}
 	while (len < field_width--)
 	{
CVSspam 0.2.8