MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / cvtncpy

Method cvtncpy

UTCP/src/UT_StrOp.cpp:53–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 // include the null-terminator.
52}
53void CUT_Str::cvtncpy(wchar_t * dest, size_t size, const char * source, size_t count)
54{
55 *dest = _T('\0');
56 size_t len = strlen(source);
57 if(len > 0)
58 {
59 ++len;
60 _TCHAR *szConverted = new _TCHAR[len+1];
61 mbstowcs(szConverted, len, source, len);
62#if _MSC_VER >= 1400
63 _tcsncpy_s(dest, size, szConverted, count);
64#else
65 UNREFERENCED_PARAMETER(size);
66 ::_tcsncpy(dest, szConverted, count);
67#endif
68 delete [] szConverted;
69 }
70}
71void CUT_Str::cvtncpy(char * dest, size_t size, const wchar_t * source, size_t count)
72{
73 *dest = '\0';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected