Each character is more than one byte, so adjust the clearing of the buffer to reflect that.tags/v1.11.90
// Alloc | // Alloc | ||||
buffer = new wchar_t[sz]; | buffer = new wchar_t[sz]; | ||||
memset(buffer, 0, sz); | |||||
memset(buffer, 0, sz * sizeof(wchar_t)); | |||||
// And convert | // And convert | ||||
out = buffer; | out = buffer; |