From 8de45a3df1ea0f2afe833e5638d1492244b19578 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 17 Oct 2012 09:59:53 +0200 Subject: [PATCH] msvcp71: Fixed basic_string::ptr implementation. --- dlls/msvcp71/string.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msvcp71/string.c b/dlls/msvcp71/string.c index 9907ad153c1..d6336ade016 100644 --- a/dlls/msvcp71/string.c +++ b/dlls/msvcp71/string.c @@ -531,7 +531,7 @@ const MSVCP_size_t MSVCP_basic_string_char_npos = -1; DEFINE_THISCALL_WRAPPER(basic_string_char_ptr, 4) char* __thiscall basic_string_char_ptr(basic_string_char *this) { - if(this->res == BUF_SIZE_CHAR-1) + if(this->res < BUF_SIZE_CHAR) return this->data.buf; return this->data.ptr; } @@ -541,7 +541,7 @@ char* __thiscall basic_string_char_ptr(basic_string_char *this) DEFINE_THISCALL_WRAPPER(basic_string_char_const_ptr, 4) const char* __thiscall basic_string_char_const_ptr(const basic_string_char *this) { - if(this->res == BUF_SIZE_CHAR-1) + if(this->res < BUF_SIZE_CHAR) return this->data.buf; return this->data.ptr; } @@ -2214,7 +2214,7 @@ const MSVCP_size_t MSVCP_basic_string_wchar_npos = -1; DEFINE_THISCALL_WRAPPER(basic_string_wchar_ptr, 4) wchar_t* __thiscall basic_string_wchar_ptr(basic_string_wchar *this) { - if(this->res == BUF_SIZE_WCHAR-1) + if(this->res < BUF_SIZE_WCHAR) return this->data.buf; return this->data.ptr; } @@ -2226,7 +2226,7 @@ wchar_t* __thiscall basic_string_wchar_ptr(basic_string_wchar *this) DEFINE_THISCALL_WRAPPER(basic_string_wchar_const_ptr, 4) const wchar_t* __thiscall basic_string_wchar_const_ptr(const basic_string_wchar *this) { - if(this->res == BUF_SIZE_WCHAR-1) + if(this->res < BUF_SIZE_WCHAR) return this->data.buf; return this->data.ptr; }