mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
osd/strconv.cpp: Deal with NUL when osd_uchar_from_osdchar uses mbstowcs.
This commit is contained in:
parent
9f33f0a2bd
commit
007948a96d
@ -294,6 +294,14 @@ error:
|
||||
|
||||
int osd_uchar_from_osdchar(char32_t *uchar, const char *osdchar, size_t count)
|
||||
{
|
||||
// TODO: should this handle count == 0?
|
||||
if (!*osdchar)
|
||||
{
|
||||
// mbstowcs stops on encountering NUL and doesn't include it in the output count
|
||||
*uchar = char32_t(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// FIXME: mbstowcs depends on global state
|
||||
wchar_t wch;
|
||||
count = mbstowcs(&wch, (char *)osdchar, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user