1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

msvcirt: Fix ostream_print_char on 0 character.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54180
This commit is contained in:
Piotr Caban 2023-01-05 19:22:17 +01:00 committed by Alexandre Julliard
parent dbe6244f10
commit 8028ef5be8

View File

@ -2670,15 +2670,12 @@ ostream* __thiscall ostream_write(ostream *this, const char *str, int count)
return this;
}
/* ?writepad@ostream@@AAEAAV1@PBD0@Z */
/* ?writepad@ostream@@AEAAAEAV1@PEBD0@Z */
DEFINE_THISCALL_WRAPPER(ostream_writepad, 12)
ostream* __thiscall ostream_writepad(ostream *this, const char *str1, const char *str2)
static ostream* ostream_writepad_len(ostream *this, const char *str1, const char *str2, int len2)
{
ios *base = ostream_get_ios(this);
int len1 = strlen(str1), len2 = strlen(str2), i;
int len1 = strlen(str1), i;
TRACE("(%p %p %p)\n", this, str1, str2);
TRACE("(%p %p %p %d)\n", this, str1, str2, len2);
/* left of the padding */
if (base->flags & (FLAGS_left|FLAGS_internal)) {
@ -2703,6 +2700,14 @@ ostream* __thiscall ostream_writepad(ostream *this, const char *str1, const char
return this;
}
/* ?writepad@ostream@@AAEAAV1@PBD0@Z */
/* ?writepad@ostream@@AEAAAEAV1@PEBD0@Z */
DEFINE_THISCALL_WRAPPER(ostream_writepad, 12)
ostream* __thiscall ostream_writepad(ostream *this, const char *str1, const char *str2)
{
return ostream_writepad_len(this, str1, str2, strlen(str2));
}
static ostream* ostream_internal_print_integer(ostream *ostr, int n, BOOL unsig, BOOL shrt)
{
ios *base = ostream_get_ios(ostr);
@ -2792,12 +2797,10 @@ static ostream* ostream_internal_print_float(ostream *ostr, double d, BOOL dbl)
DEFINE_THISCALL_WRAPPER(ostream_print_char, 8)
ostream* __thiscall ostream_print_char(ostream *this, char c)
{
const char c_str[2] = {c, 0};
TRACE("(%p %c)\n", this, c);
TRACE("(%p %d)\n", this, c);
if (ostream_opfx(this)) {
ostream_writepad(this, "", c_str);
ostream_writepad_len(this, "", &c, 1);
ostream_osfx(this);
}
return this;