re: msvcp90: handle npos as a len in basic_string<>::replace
Daniel Lehman wrote: @@ -1949,7 +1949,7 @@ basic_string_char* __thiscall basic_string_char_replace_cstr_len(basic_string_ch - if(off+len > this->size) + if(off+len < off || off+len > this->size) len = this->size-off; Wouldn't this be more elegant: if(num > this->size-pos) num = this->size-pos; ? Also, you may have missed the similar case in basic_string_char_compare_substr_cstr_len (which uses 'pos' and 'num' rather than 'off' and 'len'). See http://bugs.winehq.org/show_bug.cgi?id=31085#c5
-----Original Message----- From: daniel.r.kegel(a)gmail.com [mailto:daniel.r.kegel(a)gmail.com] On Behalf Of Dan Kegel Sent: Monday, July 16, 2012 12:27 PM To: Daniel Lehman Cc: wine-devel(a)winehq.org Subject: re: msvcp90: handle npos as a len in basic_string<>::replace
Daniel Lehman wrote:
@@ -1949,7 +1949,7 @@ basic_string_char* __thiscall basic_string_char_replace_cstr_len(basic_string_ch
- if(off+len > this->size) + if(off+len < off || off+len > this->size) len = this->size-off;
Wouldn't this be more elegant:
if(num > this->size-pos) num = this->size-pos; ?
Yeah, that looks better. I'll change it
Also, you may have missed the similar case in basic_string_char_compare_substr_cstr_len (which uses 'pos' and 'num' rather than 'off' and 'len').
I hadn't run into that issue
participants (2)
-
Dan Kegel -
Daniel Lehman