From 6a0511c5ebf959fa46281b1457f00783956e9fd8 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 10 Oct 2013 17:18:16 -0400 Subject: util.windows: Incorrect output buffer size passed to ReadConsoleOutputAttribute (fixes issue#362, thanks yanjun). --- util-src/windows.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util-src') diff --git a/util-src/windows.c b/util-src/windows.c index 121cc471..3d14ca95 100644 --- a/util-src/windows.c +++ b/util-src/windows.c @@ -58,7 +58,7 @@ static int Lget_consolecolor(lua_State *L) { if (console == INVALID_HANDLE_VALUE) return lerror(L, "GetStdHandle"); if (!GetConsoleScreenBufferInfo(console, &info)) return lerror(L, "GetConsoleScreenBufferInfo"); - if (!ReadConsoleOutputAttribute(console, &color, sizeof(WORD), info.dwCursorPosition, &read_len)) return lerror(L, "ReadConsoleOutputAttribute"); + if (!ReadConsoleOutputAttribute(console, &color, 1, info.dwCursorPosition, &read_len)) return lerror(L, "ReadConsoleOutputAttribute"); lua_pushnumber(L, color); return 1; -- cgit v1.2.3