In calling cvtcpy, allocate _tcslen + 1 of source for dest, and pass _tcslen as size.
| 31 | #if defined _UNICODE |
| 32 | // In calling cvtcpy, allocate _tcslen + 1 of source for dest, and pass _tcslen as size. |
| 33 | void CUT_Str::cvtcpy(wchar_t * dest, size_t size, const char * source, UINT codePage) |
| 34 | { |
| 35 | // now using MultiByteToWideChar to enable code page specification |
| 36 | *dest = _T('\0'); |
| 37 | int count = MultiByteToWideChar(codePage, 0, source, -1, dest, (int)size); |
| 38 | if (count == 0) { |
| 39 | *(dest+size) = _T('\0'); // v4.2 helps for ATL CString sources |
| 40 | } |
| 41 | } |
| 42 | void CUT_Str::cvtcpy(char * dest, size_t size, const wchar_t * source) |
| 43 | { |
| 44 | *dest = '\0'; |
nothing calls this directly
no outgoing calls
no test coverage detected