use wxWcslen() instead of wcslen() which isn't always available in wxWCharBuffer; do accept NULL in wx[W]CharBuffer ctor as the code elsewhere uses this
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -29,7 +29,6 @@ public:
 | 
				
			|||||||
    wxCharBuffer(const char *str)
 | 
					    wxCharBuffer(const char *str)
 | 
				
			||||||
        : m_str(str ? strdup(str) : NULL)
 | 
					        : m_str(str ? strdup(str) : NULL)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        wxASSERT_MSG( str, wxT("NULL string in wxCharBuffer") );
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    wxCharBuffer(size_t len)
 | 
					    wxCharBuffer(size_t len)
 | 
				
			||||||
@@ -71,15 +70,8 @@ public:
 | 
				
			|||||||
    wxWCharBuffer(const wchar_t *wcs)
 | 
					    wxWCharBuffer(const wchar_t *wcs)
 | 
				
			||||||
        : m_wcs((wchar_t *)NULL)
 | 
					        : m_wcs((wchar_t *)NULL)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        wxASSERT_MSG( wcs, wxT("NULL string in wxWCharBuffer") );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (wcs) {
 | 
					        if (wcs) {
 | 
				
			||||||
#if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) ) \
 | 
					          size_t siz = (wxWcslen(wcs) + 1)*sizeof(wchar_t);
 | 
				
			||||||
    || ( defined(__MWERKS__) && defined(__WXMSW__) )
 | 
					 | 
				
			||||||
          size_t siz = (std::wcslen(wcs)+1)*sizeof(wchar_t);
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
          size_t siz = (::wcslen(wcs)+1)*sizeof(wchar_t);
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
          m_wcs = (wchar_t *)malloc(siz);
 | 
					          m_wcs = (wchar_t *)malloc(siz);
 | 
				
			||||||
          memcpy(m_wcs, wcs, siz);
 | 
					          memcpy(m_wcs, wcs, siz);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user