summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-09-01 12:58:20 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-09-01 12:58:20 +0000
commiteffd251aaf06db3da5b94c1e45ff6e9ecc032f2b (patch)
treeb9edb4f7633fe3851501a8251c281948b2c96d19
parent18cd88f052aaf58314677064ab551baa053203c5 (diff)
Fix space and underline handling in rasops24_putchar(), spotted by Leon Zadorin.
-rw-r--r--sys/dev/rasops/rasops24.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/dev/rasops/rasops24.c b/sys/dev/rasops/rasops24.c
index 50b68a18566..b3a93df6e0d 100644
--- a/sys/dev/rasops/rasops24.c
+++ b/sys/dev/rasops/rasops24.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rasops24.c,v 1.5 2002/07/27 22:17:49 miod Exp $ */
+/* $OpenBSD: rasops24.c,v 1.6 2007/09/01 12:58:19 miod Exp $ */
/* $NetBSD: rasops24.c,v 1.12 2000/04/12 14:22:29 pk Exp $ */
/*-
@@ -149,15 +149,14 @@ rasops24_putchar(cookie, row, col, uc, attr)
clr[0] = ri->ri_devcmap[((u_int)attr >> 16) & 0xf];
if (uc == ' ') {
- u_char c = clr[0];
while (height--) {
dp = rp;
rp += ri->ri_stride;
for (cnt = width; cnt; cnt--) {
- *dp++ = c >> 16;
- *dp++ = c >> 8;
- *dp++ = c;
+ *dp++ = clr[0] >> 16;
+ *dp++ = clr[0] >> 8;
+ *dp++ = clr[0];
}
}
} else {
@@ -187,14 +186,12 @@ rasops24_putchar(cookie, row, col, uc, attr)
/* Do underline */
if ((attr & 1) != 0) {
- u_char c = clr[1];
-
rp -= ri->ri_stride << 1;
while (width--) {
- *rp++ = c >> 16;
- *rp++ = c >> 8;
- *rp++ = c;
+ *rp++ = clr[1] >> 16;
+ *rp++ = clr[1] >> 8;
+ *rp++ = clr[1];
}
}
}