Parcourir la 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 il y a 10 ans
Parent
révision
a17ee3610d
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1
    1
      src/core/vsprintf.c
  2. 1
    1
      src/hci/mucurses/mucurses.c

+ 1
- 1
src/core/vsprintf.c Voir le fichier

@@ -167,7 +167,7 @@ static char * format_decimal ( char *end, signed long num, int width,
167 167
  * Call's the printf_context::handler() method and increments
168 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 171
 	ctx->handler ( ctx, c );
172 172
 	++ctx->len;
173 173
 }

+ 1
- 1
src/hci/mucurses/mucurses.c Voir le fichier

@@ -75,7 +75,7 @@ void _wputch ( WINDOW *win, chtype ch, int wrap ) {
75 75
  * @v wrap	wrap "switch"
76 76
  */
77 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
 /**

Chargement…
Annuler
Enregistrer