diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2018-12-28 21:18:07 +0200 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2018-12-29 18:27:21 +0100 |
commit | d4d9b840cc4ed4fa5df61d321eae570be12e2457 (patch) | |
tree | a64b932b88611d0ad95117df9dcd5b0fb719caa1 /CHANGELOG.md | |
parent | 2dd0187fe827130dbe5a487cd08070fc7c3ae2a4 (diff) | |
download | subsurface-d4d9b840cc4ed4fa5df61d321eae570be12e2457.tar.gz |
windows.c: fix wrong usage of wcslen() for utf8 conversation
wcslen() returns the number of characters in a wchar_t string.
In the case of WideCharToMultiByte() an estimate for the size of
the utf8 buffer is needed. Using wcslen() is incorrect for such a buffer,
because for any non-ASCII character the estimate will be off by 1 byte.
Call the following instead to obtain the proper UTF8 buffer size
for the conversation:
WideCharToMultiByte(CP_UTF8, 0, utf16, -1, NULL, 0, NULL, NULL);
Also fix some missing "\n" in fprintf() calls.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'CHANGELOG.md')
0 files changed, 0 insertions, 0 deletions