[PATCH] fbcon: Fix endian bug in fbcon_putc (console mouse problem)

From
Antonino A. Daplas <hidden>
Date
2004-10-27 22:05:44
The typecast (const unsigned short *) &c in fbcon_putc is not correct for
big-endian machines.  This problem manifests as a black cursor that can be
used to erase the console screen contents.  The correct fix is to use scr_writew
instead.

Signed-off-by: Antonino Daplas <redacted>
---
 fbcon.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
--- a/drivers/video/console/fbcon.c	2004-10-26 23:49:13 +08:00
+++ b/drivers/video/console/fbcon.c	2004-10-27 09:07:57 +08:00
@@ -1012,7 +1012,10 @@
 
 static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
 {
-	fbcon_putcs(vc, (const unsigned short *) &c, 1, ypos, xpos);
+	unsigned short chr;
+
+	scr_writew(c, &chr);
+	fbcon_putcs(vc, &chr, 1, ypos, xpos);
 }
 
 static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)




-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help