mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
COMMON: Fix conversion to UTF32 for short strings
Testcase: convert 1-byte encoded single character string from 125X to UTF32, e.g. "=". Expected result: got widestring, first dword contains "=", next dword contains "\0" Actual result: got widestring, first dword contains "=", second dword contains garbage, next dword contains "\0" Reference implementation: http://www-personal.umich.edu/~bazald/l/api/_s_d_l__iconv_8c_source.html , line 887
This commit is contained in:
parent
73c2d2015d
commit
3e738f7734
@ -183,8 +183,8 @@ char *Encoding::convertIconv(const char *to, const char *from, const char *strin
|
||||
return nullptr;
|
||||
|
||||
size_t inSize = length;
|
||||
size_t outSize = inSize;
|
||||
size_t stringSize = inSize > 4 ? inSize : 4;
|
||||
size_t outSize = stringSize;
|
||||
|
||||
|
||||
#ifdef ICONV_USES_CONST
|
||||
|
Loading…
x
Reference in New Issue
Block a user