Changeset 56214

Show
Ignore:
Timestamp:
10/10/08 09:11:40 (3 months ago)
Author:
VZ
Message:

don't crash when streaming out a wxString into an std::ostream, just set the failbit instead

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wxWidgets/trunk/src/common/string.cpp

    r55945 r56214  
    169169{ 
    170170#if wxUSE_UNICODE && !wxUSE_UNICODE_UTF8 
    171     return os << (const char *)str.AsCharBuf(); 
     171    const wxCharBuffer buf(str.AsCharBuf()); 
     172    if ( !buf ) 
     173        os.clear(wxSTD ios_base::failbit); 
     174    else 
     175        os << buf.data(); 
     176 
     177    return os; 
    172178#else 
    173179    return os << str.AsInternal();