From 435595e02f50afafdaf324e4e52b229c46f174d5 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Sat, 24 Apr 1999 12:25:03 +0000 Subject: [PATCH] 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 --- src/common/string.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/common/string.cpp b/src/common/string.cpp index 532e77b6d5..539b631152 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -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 ) { -- 2.45.2