summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index f4d43442d..b50ab95eb 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -5262,7 +5262,7 @@ gotoxy(
static void
textattr(WORD wAttr)
{
- g_attrCurrent = wAttr;
+ g_attrCurrent = wAttr & 0xff;
SetConsoleTextAttribute(g_hConOut, wAttr);
}
@@ -5271,7 +5271,7 @@ textattr(WORD wAttr)
static void
textcolor(WORD wAttr)
{
- g_attrCurrent = (g_attrCurrent & 0xf0) + wAttr;
+ g_attrCurrent = (g_attrCurrent & 0xf0) + (wAttr & 0x0f);
SetConsoleTextAttribute(g_hConOut, g_attrCurrent);
}
@@ -5280,7 +5280,7 @@ textcolor(WORD wAttr)
static void
textbackground(WORD wAttr)
{
- g_attrCurrent = (g_attrCurrent & 0x0f) + (wAttr << 4);
+ g_attrCurrent = (g_attrCurrent & 0x0f) + ((wAttr & 0x0f) << 4);
SetConsoleTextAttribute(g_hConOut, g_attrCurrent);
}