On Mon, 3 Dec 2018 at 10:15, Gerd Hoffmann <[email protected]> wrote: > > 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). > > Reported-by: Michael Hanselmann <[email protected]> > Signed-off-by: Gerd Hoffmann <[email protected]> > --- > hw/usb/dev-mtp.c | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-)
Reviewed-by: Peter Maydell <[email protected]> thanks -- PMM
