Decompile fn_18265 (EncodeText)
Batch #14665 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_18265 EncodeText: logic confirmed by peer review Peer-reviewed-by: secret, Tanke, raiken Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
4e15850c32
commit
7bf0c13d8d
1 changed files with 3 additions and 3 deletions
|
|
@ -137,16 +137,16 @@ std::string EncodeText(UINT codePage, const std::wstring& text) {
|
|||
if (length == 0) {
|
||||
return "";
|
||||
}
|
||||
char* converted = static_cast<char*>(std::malloc(length));
|
||||
char* converted = new char[length];
|
||||
if (converted == nullptr) {
|
||||
return "";
|
||||
}
|
||||
if (WideCharToMultiByte(codePage, 0, text.c_str(), -1, converted, length, nullptr, nullptr) == 0) {
|
||||
std::free(converted);
|
||||
delete[] converted;
|
||||
return "";
|
||||
}
|
||||
std::string result(converted, std::strlen(converted));
|
||||
std::free(converted);
|
||||
delete[] converted;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue