Constructor should survive getting passed a null pointer for conversion.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d9e89b159c
commit
435595e02f
@ -256,8 +256,7 @@ wxString::wxString(const void *pStart, const void *pEnd)
|
||||
wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength)
|
||||
{
|
||||
// first get necessary size
|
||||
|
||||
size_t nLen = conv.MB2WC((wchar_t *) NULL, psz, 0);
|
||||
size_t nLen = psz ? conv.MB2WC((wchar_t *) NULL, psz, 0) : 0;
|
||||
|
||||
// nLength is number of *Unicode* characters here!
|
||||
if (nLen > nLength)
|
||||
@ -279,8 +278,7 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength)
|
||||
wxString::wxString(const wchar_t *pwz)
|
||||
{
|
||||
// first get necessary size
|
||||
|
||||
size_t nLen = wxWC2MB((char *) NULL, pwz, 0);
|
||||
size_t nLen = pwz ? wxWC2MB((char *) NULL, pwz, 0) : 0;
|
||||
|
||||
// empty?
|
||||
if ( nLen != 0 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user