- m_wcs = wcs ? (wchar_t *)malloc((wcslen(wcs)+1)*sizeof(wchar_t))
- : (wchar_t *)NULL;
- if (m_wcs) wcscpy(m_wcs, wcs);
+ if (wcs) {
+#if ( defined(__BORLANDC__) && (__BORLANDC__ > 0x530) ) \
+ || ( 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);
+ memcpy(m_wcs, wcs, siz);
+ }
+ else m_wcs = (wchar_t *)NULL;