Software /
code /
prosody
Comparison
util-src/windows.c @ 5864:22b1d18eb919
util.windows: Incorrect output buffer size passed to ReadConsoleOutputAttribute (fixes issue#362, thanks yanjun).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 10 Oct 2013 17:18:16 -0400 |
parent | 4128:b6d072a3668d |
child | 6411:6c8f6364bc48 |
comparison
equal
deleted
inserted
replaced
5853:3ee3d79db18c | 5864:22b1d18eb919 |
---|---|
56 | 56 |
57 CONSOLE_SCREEN_BUFFER_INFO info; | 57 CONSOLE_SCREEN_BUFFER_INFO info; |
58 | 58 |
59 if (console == INVALID_HANDLE_VALUE) return lerror(L, "GetStdHandle"); | 59 if (console == INVALID_HANDLE_VALUE) return lerror(L, "GetStdHandle"); |
60 if (!GetConsoleScreenBufferInfo(console, &info)) return lerror(L, "GetConsoleScreenBufferInfo"); | 60 if (!GetConsoleScreenBufferInfo(console, &info)) return lerror(L, "GetConsoleScreenBufferInfo"); |
61 if (!ReadConsoleOutputAttribute(console, &color, sizeof(WORD), info.dwCursorPosition, &read_len)) return lerror(L, "ReadConsoleOutputAttribute"); | 61 if (!ReadConsoleOutputAttribute(console, &color, 1, info.dwCursorPosition, &read_len)) return lerror(L, "ReadConsoleOutputAttribute"); |
62 | 62 |
63 lua_pushnumber(L, color); | 63 lua_pushnumber(L, color); |
64 return 1; | 64 return 1; |
65 } | 65 } |
66 static int Lset_consolecolor(lua_State *L) { | 66 static int Lset_consolecolor(lua_State *L) { |