[Box Backup-commit] COMMIT r966 - box/chris/merge/lib/win32

subversion at fluffy.co.uk subversion at fluffy.co.uk
Mon Sep 4 01:10:38 BST 2006


Author: chris
Date: 2006-09-04 01:10:38 +0100 (Mon, 04 Sep 2006)
New Revision: 966

Modified:
   box/chris/merge/lib/win32/emu.cpp
Log:
(refs #3)

Changed WideSize from int to size_t

Don't allow space for null terminator that will not be added


Modified: box/chris/merge/lib/win32/emu.cpp
===================================================================
--- box/chris/merge/lib/win32/emu.cpp	2006-09-04 00:09:26 UTC (rev 965)
+++ box/chris/merge/lib/win32/emu.cpp	2006-09-04 00:10:38 UTC (rev 966)
@@ -1559,7 +1559,7 @@
 		return -1;
 	}
 
-	int WideSize = BufferSize / 5;
+	size_t WideSize = BufferSize / 5;
 	WCHAR* pWideBuffer = new WCHAR [WideSize];
 
 	if (!pWideBuffer)
@@ -1573,7 +1573,7 @@
 	if (!ReadConsoleW(
 			hConsole,
 			pWideBuffer,
-			WideSize - 1,
+			WideSize, // will not be null terminated by ReadConsole
 			&numCharsRead,
 			NULL // reserved
 		)) 




More information about the Boxbackup-commit mailing list