Teach the std::wstring data formatter how to properly display strings with embedded NUL bytes

llvm-svn: 242501
This commit is contained in:
Enrico Granata
2015-07-17 01:56:25 +00:00
parent 2d8315f806
commit 8101f570f8
4 changed files with 46 additions and 5 deletions

View File

@@ -382,6 +382,8 @@ DumpUTFBufferToStream (ConversionResult (*ConvertFunction) (const SourceDataType
utf8_data_ptr = (UTF8*)utf8_data_buffer_sp->GetBytes();
utf8_data_end_ptr = utf8_data_ptr + utf8_data_buffer_sp->GetByteSize();
ConvertFunction ( &data_ptr, data_end_ptr, &utf8_data_ptr, utf8_data_end_ptr, lenientConversion );
if (false == zero_is_terminator)
utf8_data_end_ptr = utf8_data_ptr;
utf8_data_ptr = (UTF8*)utf8_data_buffer_sp->GetBytes(); // needed because the ConvertFunction will change the value of the data_ptr
}
else