Browse Source

[console] Fix display of characters with top bit set

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>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
a17ee3610d
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      src/core/vsprintf.c
  2. 1
    1
      src/hci/mucurses/mucurses.c

+ 1
- 1
src/core/vsprintf.c View File

167
  * Call's the printf_context::handler() method and increments
167
  * Call's the printf_context::handler() method and increments
168
  * printf_context::len.
168
  * printf_context::len.
169
  */
169
  */
170
-static inline void cputchar ( struct printf_context *ctx, unsigned int c ) {
170
+static inline void cputchar ( struct printf_context *ctx, unsigned char c ) {
171
 	ctx->handler ( ctx, c );
171
 	ctx->handler ( ctx, c );
172
 	++ctx->len;
172
 	++ctx->len;
173
 }
173
 }

+ 1
- 1
src/hci/mucurses/mucurses.c View File

75
  * @v wrap	wrap "switch"
75
  * @v wrap	wrap "switch"
76
  */
76
  */
77
 void _wputc ( WINDOW *win, char c, int wrap ) {
77
 void _wputc ( WINDOW *win, char c, int wrap ) {
78
-	_wputch ( win, ( c | win->attrs ), wrap );
78
+	_wputch ( win, ( ( ( unsigned char ) c ) | win->attrs ), wrap );
79
 }
79
 }
80
 
80
 
81
 /**
81
 /**

Loading…
Cancel
Save