Fix #1007: strcpy requires the number of chars not bytes

This commit is contained in:
Paddy Xu
2021-10-18 21:22:24 +02:00
parent fe6dae67ce
commit e640a8b98a
2 changed files with 3 additions and 3 deletions

View File

@@ -103,7 +103,7 @@ void DOpus::ParseXmlBuffer(PWCHAR buffer)
auto b = new WCHAR[size];
MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, -1, b, size);
wcscpy_s(buffer, MAX_PATH_EX, b); // DOpus supports Long Path
wcscpy_s(buffer, wcslen(b) + 1, b); // DOpus supports Long Path
delete[] b;
return; // we now cares only the first result