X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/906c935a80b10d53cecf57f71ab5f3f4f1d529ec..87f0b1323b7ac77f02133b836c8dfee63b0fd387:/src/common/fs_mem.cpp diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index e306437de4..5f96257100 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -186,13 +186,9 @@ void wxMemoryFSHandlerBase::AddFileWithMimeType(const wxString& filename, const wxString& textdata, const wxString& mimetype) { - AddFileWithMimeType - ( - filename, - static_cast(textdata.To8BitData()), - wxStrlen(static_cast(textdata.To8BitData())), - mimetype - ); + const wxCharBuffer buf(textdata.To8BitData()); + + AddFileWithMimeType(filename, buf.data(), buf.length(), mimetype); }