- wxASSERT_MSG( wcs, "NULL string in wxWCharBuffer" );
-
- m_wcs = wcs ? wcsdup(wcs) : (wchar_t *)NULL;
+ wxASSERT_MSG( wcs, wxT("NULL string in wxWCharBuffer") );
+
+ if (wcs) {
+ size_t siz = (wcslen(wcs)+1)*sizeof(wchar_t);
+ m_wcs = (wchar_t *)malloc(siz);
+ memcpy(m_wcs, wcs, siz);
+ }
+ else m_wcs = (wchar_t *)NULL;
+ }
+ wxWCharBuffer(size_t len)
+ {
+ m_wcs = (wchar_t *)malloc((len+1)*sizeof(wchar_t));
+ m_wcs[len] = L'\0';