aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-12-03 11:10:44 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-12-03 19:39:04 +0100
commit6de02a13232a84261bd2d5e07013d6e6572cd60f (patch)
treeae9180f0a0f5c575f45ffff859670b5534ed0f77 /hw/core
parent039d4e3df0049bdd8f93a2de735a816483b13954 (diff)
downloadqemu-6de02a13232a84261bd2d5e07013d6e6572cd60f.zip
qemu-6de02a13232a84261bd2d5e07013d6e6572cd60f.tar.gz
qemu-6de02a13232a84261bd2d5e07013d6e6572cd60f.tar.bz2
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 'hw/core')
0 files changed, 0 insertions, 0 deletions