Sergey Burladyan <eshkinkot(at)gmail(dot)com> writes:
> Maybe it should look something like this:
> + wcstombs_s(&charsConverted, mbs, mb_len + 1, wchar_str, mb_len);
Ah, and we missed check for error.
Something like this, maybe:
+#ifdef __WIN32__
+ size_t charsConverted = 0;
+ if (wcstombs_s(&charsConverted, mbs, mb_len + 1, wchar_str, mb_len) != 0) {
+ delete [] mbs;
+ return NULL;
+ }
+#else
--
Sergey Burladyan