Author: tkreuzer
Date: Sun Dec 27 18:22:13 2015
New Revision: 70443
URL:
http://svn.reactos.org/svn/reactos?rev=70443&view=rev
Log:
[CRT]
Fix handling of NULL buffer in streamout. Fixes a few msvcrt_crt_apitests, while it breaks
a few for crtdll. crtdll is broken anyway and obsolete, nothing uses it, so it doesn't
really matter.
CORE-9105 #resolve
Modified:
trunk/reactos/lib/sdk/crt/printf/streamout.c
Modified: trunk/reactos/lib/sdk/crt/printf/streamout.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/printf/streamo…
==============================================================================
--- trunk/reactos/lib/sdk/crt/printf/streamout.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/printf/streamout.c [iso-8859-1] Sun Dec 27 18:22:13 2015
@@ -227,11 +227,10 @@
int
streamout_char(FILE *stream, int chr)
{
-#ifdef _LIBCNT_
- if ((stream->_flag & _IOSTRG) && (!stream->_ptr))
+#if !defined(_USER32_WSPRINTF)
+ if ((stream->_flag & _IOSTRG) && (stream->_base == NULL))
return 1;
-#endif
-
+#endif
#if defined(_USER32_WSPRINTF) || defined(_LIBCNT_)
/* Check if the buffer is full */
if (stream->_cnt < sizeof(TCHAR))
@@ -254,6 +253,11 @@
TCHAR chr;
int written = 0;
+#if !defined(_USER32_WSPRINTF)
+ if ((stream->_flag & _IOSTRG) && (stream->_base == NULL))
+ return count;
+#endif
+
while (count--)
{
#ifdef _UNICODE
@@ -276,6 +280,11 @@
{
wchar_t chr;
int written = 0;
+
+#if defined(_UNICODE) && !defined(_USER32_WSPRINTF)
+ if ((stream->_flag & _IOSTRG) && (stream->_base == NULL))
+ return count;
+#endif
while (count--)
{