]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[console] Fix display of characters with top bit set
authorMichael Brown <mcb30@ipxe.org>
Thu, 13 Mar 2014 14:20:10 +0000 (14:20 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 13 Mar 2014 14:21:59 +0000 (14:21 +0000)
Inhibit implicit sign-padding of characters with the top bit set
(e.g. accented characters), which confuses the mucurses library by
colliding with the bits used to store character attributes and
colours.

Reported-by: Marc Delisle <Marc.Delisle@cegepsherbrooke.qc.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/vsprintf.c
src/hci/mucurses/mucurses.c

index 5cc7231087091eb3d759b84dc5e888b70cc08a53..54811b11b96b5c956e6f37ebd9dc7868863d4977 100644 (file)
@@ -167,7 +167,7 @@ static char * format_decimal ( char *end, signed long num, int width,
  * Call's the printf_context::handler() method and increments
  * printf_context::len.
  */
-static inline void cputchar ( struct printf_context *ctx, unsigned int c ) {
+static inline void cputchar ( struct printf_context *ctx, unsigned char c ) {
        ctx->handler ( ctx, c );
        ++ctx->len;
 }
index c368b7637ce88818d0009ec45945363998a9335f..b67445baf50a1d2974ccbaf8b2cf9b4fd849b802 100644 (file)
@@ -75,7 +75,7 @@ void _wputch ( WINDOW *win, chtype ch, int wrap ) {
  * @v wrap     wrap "switch"
  */
 void _wputc ( WINDOW *win, char c, int wrap ) {
-       _wputch ( win, ( c | win->attrs ), wrap );
+       _wputch ( win, ( ( ( unsigned char ) c ) | win->attrs ), wrap );
 }
 
 /**