Skip to content

Commit

Permalink
[console] Fix display of characters with top bit set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Mar 13, 2014
1 parent 2602965 commit a17ee36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/vsprintf.c
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/hci/mucurses/mucurses.c
Expand Up @@ -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 );
}

/**
Expand Down

0 comments on commit a17ee36

Please sign in to comment.