summaryrefslogtreecommitdiffstats
path: root/discover/platform-powerpc.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2014-03-13 15:18:04 +0800
committerJeremy Kerr <jk@ozlabs.org>2014-04-10 11:18:26 +0800
commitada4ea46dd44e667bfe6341e0b7b5366e5741351 (patch)
tree99359c98216639782deb2623c6a9ed8f6d4808d7 /discover/platform-powerpc.c
parent6c7cf0a58b0e4be046b2367c93925e1c4895dd6c (diff)
downloadpetitboot-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
OpenPOWER on IntegriCloud