Commit c69ac672 authored by Iván Matellanes's avatar Iván Matellanes Committed by Alexandre Julliard

msvcirt: Fix implementation of streambuf::sync.

parent b36a526f
......@@ -457,7 +457,7 @@ DEFINE_THISCALL_WRAPPER(streambuf_sync, 4)
int __thiscall streambuf_sync(streambuf *this)
{
TRACE("(%p)\n", this);
return (this->gptr == this->egptr && this->pbase == this->pptr) ? 0 : EOF;
return (this->gptr >= this->egptr && this->pbase >= this->pptr) ? 0 : EOF;
}
/* ?unbuffered@streambuf@@IAEXH@Z */
......
......@@ -372,7 +372,7 @@ static void test_streambuf(void)
ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
sb.gptr = sb.egptr + 1;
ret = (int) call_func1(p_streambuf_sync, &sb);
todo_wine ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
sb.gptr = sb.eback;
ret = (int) call_func1(p_streambuf_sync, &sb2);
ok(ret == EOF, "sync failed, expected EOF got %d\n", ret);
......@@ -381,7 +381,7 @@ static void test_streambuf(void)
ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
sb2.pptr = sb2.pbase - 1;
ret = (int) call_func1(p_streambuf_sync, &sb2);
todo_wine ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
sb2.pptr = sb2.epptr;
ret = (int) call_func1(p_streambuf_sync, &sb3);
ok(ret == 0, "sync failed, expected 0 got %d\n", ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment