Piotr Caban : msvcp90: Fixed basic_streambuf:: sputn functions behaviour when there's no place in buffer.

Alexandre Julliard julliard at winehq.org
Wed Aug 15 14:08:33 CDT 2012


Module: wine
Branch: master
Commit: 76821340a4ece7a4f140b96f7d2e62655634eaab
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=76821340a4ece7a4f140b96f7d2e62655634eaab

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Aug 15 10:27:09 2012 +0200

msvcp90: Fixed basic_streambuf::sputn functions behaviour when there's no place in buffer.

---

 dlls/msvcp90/ios.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index a053103..43fb46f 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -1031,7 +1031,7 @@ streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this,
         if(chunk > count-copied)
             chunk = count-copied;
 
-        if(chunk) {
+        if(chunk > 0) {
             memcpy_s(ptr+copied, size, *this->prpos, chunk);
             *this->prpos += chunk;
             *this->prsize -= chunk;
@@ -1450,7 +1450,7 @@ streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, co
         if(chunk > count-copied)
             chunk = count-copied;
 
-        if(chunk) {
+        if(chunk > 0) {
             memcpy(*this->pwpos, ptr+copied, chunk);
             *this->pwpos += chunk;
             *this->pwsize -= chunk;
@@ -1776,7 +1776,7 @@ streamsize __thiscall basic_streambuf_wchar__Xsgetn_s(basic_streambuf_wchar *thi
         if(chunk > count-copied)
             chunk = count-copied;
 
-        if(chunk) {
+        if(chunk > 0) {
             memcpy_s(ptr+copied, size, *this->prpos, chunk);
             *this->prpos += chunk;
             *this->prsize -= chunk;
@@ -2269,7 +2269,7 @@ streamsize __thiscall basic_streambuf_wchar_xsputn(basic_streambuf_wchar *this,
         if(chunk > count-copied)
             chunk = count-copied;
 
-        if(chunk) {
+        if(chunk > 0) {
             memcpy(*this->pwpos, ptr+copied, chunk);
             *this->pwpos += chunk;
             *this->pwsize -= chunk;




More information about the wine-cvs mailing list