Author: greatlrd Date: Wed Jun 7 02:43:41 2006 New Revision: 22255
URL: http://svn.reactos.ru/svn/reactos?rev=22255&view=rev Log: fixing two more bugs in *printf strings version. this make we pass one more of wine test
Modified: trunk/reactos/lib/rtl/sprintf.c trunk/reactos/lib/rtl/swprintf.c
Modified: trunk/reactos/lib/rtl/sprintf.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/rtl/sprintf.c?rev=22255&... ============================================================================== --- trunk/reactos/lib/rtl/sprintf.c (original) +++ trunk/reactos/lib/rtl/sprintf.c Wed Jun 7 02:43:41 2006 @@ -286,6 +286,10 @@ string(char* buf, char* end, const char* s, int len, int field_width, int precision, int flags) { int i; + char c; + + c = (flags & ZEROPAD) ? '0' : ' '; + if (s == NULL) { s = "<NULL>"; @@ -309,7 +313,7 @@ while (len < field_width--) { if (buf <= end) - *buf = ' '; + *buf = c; ++buf; } for (i = 0; i < len; ++i) @@ -331,6 +335,10 @@ stringw(char* buf, char* end, const wchar_t* sw, int len, int field_width, int precision, int flags) { int i; + char c; + + c = (flags & ZEROPAD) ? '0' : ' '; + if (sw == NULL) { sw = L"<NULL>"; @@ -354,7 +362,7 @@ while (len < field_width--) { if (buf <= end) - *buf = ' '; + *buf = c; buf++; } for (i = 0; i < len; ++i)
Modified: trunk/reactos/lib/rtl/swprintf.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/rtl/swprintf.c?rev=22255... ============================================================================== --- trunk/reactos/lib/rtl/swprintf.c (original) +++ trunk/reactos/lib/rtl/swprintf.c Wed Jun 7 02:43:41 2006 @@ -286,6 +286,10 @@ string(wchar_t* buf, wchar_t* end, const char* s, int len, int field_width, int precision, int flags) { int i; + wchar_t c; + + c = (flags & ZEROPAD) ? L'0' : L' '; + if (s == NULL) { s = "<NULL>"; @@ -309,7 +313,7 @@ while (len < field_width--) { if (buf <= end) - *buf = L' '; + *buf = c; ++buf; } for (i = 0; i < len; ++i) @@ -331,6 +335,10 @@ stringw(wchar_t* buf, wchar_t* end, const wchar_t* sw, int len, int field_width, int precision, int flags) { int i; + wchar_t c; + + c = (flags & ZEROPAD) ? L'0' : L' '; + if (sw == NULL) { sw = L"<NULL>"; @@ -354,7 +362,7 @@ while (len < field_width--) { if (buf <= end) - *buf = L' '; + *buf = c; buf++; } for (i = 0; i < len; ++i)