Skip to content

Commit 84090f9

Browse files
committed
FIX: resolved possible buffer overrun warning
1 parent 7384765 commit 84090f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/os/win32/dev-stdio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ static void Close_StdIO_Local(void)
249249
// WindowTitle.
250250
// Fetch current window title.
251251

252-
GetConsoleTitle((LPWSTR)pszOldWindowTitle, MY_BUFSIZE);
252+
GetConsoleTitle((LPWSTR)pszOldWindowTitle, MY_BUFSIZE>>1); // size is in wide chars, not bytes!
253253

254254
// Format a "unique" NewWindowTitle.
255255
wsprintf((LPWSTR)pszNewWindowTitle, (LPCWSTR)"%d/%d",

0 commit comments

Comments
 (0)