* fhandler_console.cc (set_console_title): Set buffer size to

TITLESIZE + 1.  Call sys_mbstowcs with correct destination length.
This commit is contained in:
Corinna Vinschen 2009-07-25 08:27:10 +00:00
parent e2b6bacd35
commit 6359951b47
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-07-25 Corinna Vinschen <corinna@vinschen.de>
* fhandler_console.cc (set_console_title): Set buffer size to
TITLESIZE + 1. Call sys_mbstowcs with correct destination length.
2009-07-24 Christopher Faylor <me+cygwin@cgf.cx>
* sigproc.h (wait_for_sigthread): Eliminate parameter.

View File

@ -1892,8 +1892,8 @@ fhandler_console::set_close_on_exec (bool val)
void __stdcall
set_console_title (char *title)
{
wchar_t buf[257];
sys_mbstowcs (buf, sizeof buf, title);
wchar_t buf[TITLESIZE + 1];
sys_mbstowcs (buf, TITLESIZE + 1, title);
lock_ttys here (15000);
SetConsoleTitleW (buf);
debug_printf ("title '%W'", buf);