diff --git a/dlls/msvcp60/ios.c b/dlls/msvcp60/ios.c index 08a38488199..02e903d6eb7 100644 --- a/dlls/msvcp60/ios.c +++ b/dlls/msvcp60/ios.c @@ -7617,9 +7617,9 @@ basic_istream_char* __cdecl basic_istream_char_getline_bstr_delim( TRACE("(%p %p %c)\n", istream, str, delim); + basic_string_char_clear(str); if(basic_istream_char_sentry_create(istream, TRUE)) { basic_streambuf_char *strbuf = basic_ios_char_rdbuf_get(base); - basic_string_char_clear(str); c = basic_streambuf_char_sgetc(strbuf); for(; c!=(unsigned char)delim && c!=EOF; c = basic_streambuf_char_snextc(strbuf)) @@ -8909,9 +8909,9 @@ basic_istream_wchar* __cdecl basic_istream_wchar_getline_bstr_delim( TRACE("(%p %p %c)\n", istream, str, delim); + basic_string_wchar_clear(str); if(basic_istream_wchar_sentry_create(istream, TRUE)) { basic_streambuf_wchar *strbuf = basic_ios_wchar_rdbuf_get(base); - basic_string_wchar_clear(str); c = basic_streambuf_wchar_sgetc(strbuf); for(; c!=delim && c!=WEOF; c = basic_streambuf_wchar_snextc(strbuf)) diff --git a/dlls/msvcp60/string.c b/dlls/msvcp60/string.c index 803cd33ab05..d2e1c81c37e 100644 --- a/dlls/msvcp60/string.c +++ b/dlls/msvcp60/string.c @@ -153,7 +153,8 @@ void __thiscall basic_string_char__Eos(basic_string_char *this, MSVCP_size_t len void basic_string_char_clear(basic_string_char *this) { - basic_string_char__Eos(this, 0); + if(this->ptr) + basic_string_char__Eos(this, 0); } /* ?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEX_N@Z */ @@ -1865,7 +1866,8 @@ void __thiscall basic_string_wchar__Eos(basic_string_wchar *this, MSVCP_size_t l void basic_string_wchar_clear(basic_string_wchar *this) { - basic_string_wchar__Eos(this, 0); + if(this->ptr) + basic_string_wchar__Eos(this, 0); } /* ?_Tidy@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@AAEX_N@Z */