diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-12-03 11:10:44 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-12-03 19:39:04 +0100 |
commit | 6de02a13232a84261bd2d5e07013d6e6572cd60f (patch) | |
tree | ae9180f0a0f5c575f45ffff859670b5534ed0f77 /bt-host.c | |
parent | 039d4e3df0049bdd8f93a2de735a816483b13954 (diff) |
usb-mtp: fix utf16_to_str
Make utf16_to_str return an allocated string. Remove the assumtion that
the number of string bytes equals the number of utf16 chars (which is
only true for ascii chars). Instead call wcstombs twice, once to figure
the storage size and once for the actual conversion (as suggested by the
wcstombs manpage).
FIXME: surrogate pairs are not working correctly. Pre-existing bug,
fixing that is left for another day.
Reported-by: Michael Hanselmann <public@hansmi.ch>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20181203101045.27976-2-kraxel@redhat.com
Diffstat (limited to 'bt-host.c')
0 files changed, 0 insertions, 0 deletions