fixed size of buffer returned by wxFormatConverter (it was too large before)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -152,7 +152,7 @@ public:
|
||||
m_nCopied = 0;
|
||||
}
|
||||
|
||||
wxCharTypeBuffer<CharType> Convert(const CharType *format)
|
||||
wxScopedCharTypeBuffer<CharType> Convert(const CharType *format)
|
||||
{
|
||||
// this is reset to NULL if we modify the format string
|
||||
m_fmtOrig = format;
|
||||
@@ -263,12 +263,14 @@ public:
|
||||
// format
|
||||
if ( m_fmtOrig )
|
||||
{
|
||||
return wxCharTypeBuffer<CharType>::CreateNonOwned(m_fmtOrig);
|
||||
return wxScopedCharTypeBuffer<CharType>::CreateNonOwned(m_fmtOrig);
|
||||
}
|
||||
else
|
||||
{
|
||||
// NULL-terminate converted format string:
|
||||
*m_fmtLast = 0;
|
||||
// shrink converted format string to actual size (instead of
|
||||
// over-sized allocation from CopyAllBefore()) and NUL-terminate
|
||||
// it:
|
||||
m_fmt.shrink(m_fmtLast - m_fmt.data());
|
||||
return m_fmt;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user