Skip to content

Commit a17ee36

Browse files
committed
[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>
1 parent 2602965 commit a17ee36

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/vsprintf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static char * format_decimal ( char *end, signed long num, int width,
167167
* Call's the printf_context::handler() method and increments
168168
* printf_context::len.
169169
*/
170-
static inline void cputchar ( struct printf_context *ctx, unsigned int c ) {
170+
static inline void cputchar ( struct printf_context *ctx, unsigned char c ) {
171171
ctx->handler ( ctx, c );
172172
++ctx->len;
173173
}

src/hci/mucurses/mucurses.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void _wputch ( WINDOW *win, chtype ch, int wrap ) {
7575
* @v wrap wrap "switch"
7676
*/
7777
void _wputc ( WINDOW *win, char c, int wrap ) {
78-
_wputch ( win, ( c | win->attrs ), wrap );
78+
_wputch ( win, ( ( ( unsigned char ) c ) | win->attrs ), wrap );
7979
}
8080

8181
/**

0 commit comments

Comments
 (0)