fixing two more bugs in *printf strings version.

this make we pass one more of wine test

svn path=/trunk/; revision=22255
This commit is contained in:
Magnus Olsen
2006-06-06 22:43:41 +00:00
parent 6c2296718e
commit 26cd015421
2 changed files with 20 additions and 4 deletions
+10 -2
View File
@@ -286,6 +286,10 @@ static char*
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 @@ string(char* buf, char* end, const char* s, int len, int field_width, int precis
while (len < field_width--)
{
if (buf <= end)
*buf = ' ';
*buf = c;
++buf;
}
for (i = 0; i < len; ++i)
@@ -331,6 +335,10 @@ static char*
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 @@ stringw(char* buf, char* end, const wchar_t* sw, int len, int field_width, int p
while (len < field_width--)
{
if (buf <= end)
*buf = ' ';
*buf = c;
buf++;
}
for (i = 0; i < len; ++i)
+10 -2
View File
@@ -286,6 +286,10 @@ static wchar_t*
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 @@ string(wchar_t* buf, wchar_t* end, const char* s, int len, int field_width, int
while (len < field_width--)
{
if (buf <= end)
*buf = L' ';
*buf = c;
++buf;
}
for (i = 0; i < len; ++i)
@@ -331,6 +335,10 @@ static wchar_t*
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 @@ stringw(wchar_t* buf, wchar_t* end, const wchar_t* sw, int len, int field_width,
while (len < field_width--)
{
if (buf <= end)
*buf = L' ';
*buf = c;
buf++;
}
for (i = 0; i < len; ++i)