Piotr Caban : msvcp90: Don't overwrite string length in basic_string::_Grow .

Alexandre Julliard julliard at winehq.org
Wed Sep 14 12:25:38 CDT 2011


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Sep 13 19:26:28 2011 +0200

msvcp90: Don't overwrite string length in basic_string::_Grow.

---

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

diff --git a/dlls/msvcp90/string.c b/dlls/msvcp90/string.c
index d8a7728..a2cebec 100644
--- a/dlls/msvcp90/string.c
+++ b/dlls/msvcp90/string.c
@@ -589,7 +589,7 @@ MSVCP_bool __thiscall basic_string_char_grow(
         basic_string_char *this, MSVCP_size_t new_size, MSVCP_bool trim)
 {
     if(this->res < new_size) {
-        MSVCP_size_t new_res = new_size;
+        MSVCP_size_t new_res = new_size, len = this->size;
         char *ptr;
 
         new_res |= 0xf;
@@ -613,7 +613,7 @@ MSVCP_bool __thiscall basic_string_char_grow(
         basic_string_char_tidy(this, TRUE, 0);
         this->data.ptr = ptr;
         this->res = new_size;
-        basic_string_char_eos(this, this->size);
+        basic_string_char_eos(this, len);
     } else if(trim && new_size < BUF_SIZE_CHAR)
         basic_string_char_tidy(this, TRUE,
                 new_size<this->size ? new_size : this->size);
@@ -1609,7 +1609,7 @@ MSVCP_bool __thiscall basic_string_wchar_grow(
         basic_string_wchar *this, MSVCP_size_t new_size, MSVCP_bool trim)
 {
     if(this->res < new_size) {
-        MSVCP_size_t new_res = new_size;
+        MSVCP_size_t new_res = new_size, len = this->size;
         wchar_t *ptr;
 
         new_res |= 0xf;
@@ -1633,7 +1633,7 @@ MSVCP_bool __thiscall basic_string_wchar_grow(
         basic_string_wchar_tidy(this, TRUE, 0);
         this->data.ptr = ptr;
         this->res = new_size;
-        basic_string_wchar_eos(this, this->size);
+        basic_string_wchar_eos(this, len);
     } else if(trim && new_size < BUF_SIZE_WCHAR)
         basic_string_wchar_tidy(this, TRUE,
                 new_size<this->size ? new_size : this->size);




More information about the wine-cvs mailing list