mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 20:18:28 +00:00
msvcirt: Set the error flag in writepad without locking.
writepad() is always called between opfx() and osfx(), so the ios object is already locked. Signed-off-by: Iván Matellanes <matellanes.ivan@gmail.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0afcd1aeb3
commit
3be6ac0d33
1 changed files with 5 additions and 5 deletions
|
@ -2572,22 +2572,22 @@ ostream* __thiscall ostream_writepad(ostream *this, const char *str1, const char
|
|||
/* left of the padding */
|
||||
if (base->flags & (FLAGS_left|FLAGS_internal)) {
|
||||
if (streambuf_sputn(base->sb, str1, len1) != len1)
|
||||
ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
|
||||
base->state |= IOSTATE_failbit | IOSTATE_badbit;
|
||||
if (!(base->flags & FLAGS_internal))
|
||||
if (streambuf_sputn(base->sb, str2, len2) != len2)
|
||||
ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
|
||||
base->state |= IOSTATE_failbit | IOSTATE_badbit;
|
||||
}
|
||||
/* add padding to fill the width */
|
||||
for (i = len1 + len2; i < base->width; i++)
|
||||
if (streambuf_sputc(base->sb, base->fill) == EOF)
|
||||
ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
|
||||
base->state |= IOSTATE_failbit | IOSTATE_badbit;
|
||||
/* right of the padding */
|
||||
if ((base->flags & (FLAGS_left|FLAGS_internal)) != FLAGS_left) {
|
||||
if (!(base->flags & (FLAGS_left|FLAGS_internal)))
|
||||
if (streambuf_sputn(base->sb, str1, len1) != len1)
|
||||
ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
|
||||
base->state |= IOSTATE_failbit | IOSTATE_badbit;
|
||||
if (streambuf_sputn(base->sb, str2, len2) != len2)
|
||||
ios_clear(base, base->state | IOSTATE_failbit | IOSTATE_badbit);
|
||||
base->state |= IOSTATE_failbit | IOSTATE_badbit;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue