summaryrefslogtreecommitdiff
path: root/lib/win32/emu.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-09-04 00:10:38 +0000
committerChris Wilson <chris+github@qwirx.com>2006-09-04 00:10:38 +0000
commit38429ae610b92e83cc0febb232eaa5149a0bd494 (patch)
tree49815fb7b9f88afa1bad3da0d6afe5c6d351c3cb /lib/win32/emu.cpp
parent012c1b4c977bc94d4f8859c04890223f48881463 (diff)
(refs #3)
Changed WideSize from int to size_t Don't allow space for null terminator that will not be added
Diffstat (limited to 'lib/win32/emu.cpp')
-rw-r--r--lib/win32/emu.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp
index 109e54f6..91684f1c 100644
--- a/lib/win32/emu.cpp
+++ b/lib/win32/emu.cpp
@@ -1559,7 +1559,7 @@ int console_read(char* pBuffer, size_t BufferSize)
return -1;
}
- int WideSize = BufferSize / 5;
+ size_t WideSize = BufferSize / 5;
WCHAR* pWideBuffer = new WCHAR [WideSize];
if (!pWideBuffer)
@@ -1573,7 +1573,7 @@ int console_read(char* pBuffer, size_t BufferSize)
if (!ReadConsoleW(
hConsole,
pWideBuffer,
- WideSize - 1,
+ WideSize, // will not be null terminated by ReadConsole
&numCharsRead,
NULL // reserved
))