mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 17:01:06 +00:00
String_util: Explicitly use a const_cast when calling iconv
This commit is contained in:
parent
37a0a22010
commit
b1890d012c
@ -391,8 +391,14 @@ static std::string CodeToUTF8(const char* fromcode, const std::basic_string<T>&
|
||||
|
||||
while (0 != src_bytes)
|
||||
{
|
||||
size_t const iconv_result = iconv(conv_desc, (char**)(&src_buffer), &src_bytes,
|
||||
&dst_buffer, &dst_bytes);
|
||||
const char** iconv_inbuff = reinterpret_cast<const char**>(&src_buffer);
|
||||
|
||||
// This const_cast is here because iconv declares its second argument as
|
||||
// "char**" where it should be "const char**" because the only thing
|
||||
// actually modified is the pointer, hence the const_cast.
|
||||
const size_t iconv_result = iconv(conv_desc,
|
||||
const_cast<char**>(iconv_inbuff),
|
||||
&src_bytes, &dst_buffer, &dst_bytes);
|
||||
|
||||
if (static_cast<size_t>(-1) == iconv_result)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user