diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-03-13 15:18:04 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-04-10 11:18:26 +0800 |
commit | ada4ea46dd44e667bfe6341e0b7b5366e5741351 (patch) | |
tree | 99359c98216639782deb2623c6a9ed8f6d4808d7 /discover/platform-powerpc.c | |
parent | 6c7cf0a58b0e4be046b2367c93925e1c4895dd6c (diff) | |
download | petitboot-ada4ea46dd44e667bfe6341e0b7b5366e5741351.zip petitboot-ada4ea46dd44e667bfe6341e0b7b5366e5741351.tar.gz |
ui/ncurses: Ensure boot option labels are displayable as menu items
ncurses' new_item() expects the name parameter to be a "printable
string", by converting it to a wchar *, and checking that each character
is printable with iswprint(). If it fails, we won't see a boot option at
all.
This change introduces a function to convert the label into something we
know is printable, and valid UTF-8. If mbstowcs fails, we replace it
with a generic 'Invalid option' label. If we encounter a valid multibyte
string with unprintable characters, we replace those with U+fffd
REPLACEMENT CHARACTER.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/platform-powerpc.c')
0 files changed, 0 insertions, 0 deletions