mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.0852: MS-Windows: possible crash when giving a message on startup
Problem: MS-Windows: possible crash when giving a message on startup. Solution: Initialize length. (Yasuhiro Matsumoto, closes #1931)
This commit is contained in:
@@ -2639,13 +2639,14 @@ msg_puts_printf(char_u *str, int maxlen)
|
|||||||
# if defined(FEAT_MBYTE) && !defined(FEAT_GUI_MSWIN)
|
# if defined(FEAT_MBYTE) && !defined(FEAT_GUI_MSWIN)
|
||||||
if (enc_codepage >= 0 && (int)GetConsoleCP() != enc_codepage)
|
if (enc_codepage >= 0 && (int)GetConsoleCP() != enc_codepage)
|
||||||
{
|
{
|
||||||
int len;
|
int inlen = STRLEN(str);
|
||||||
WCHAR *widestr = (WCHAR *)enc_to_utf16(str, &len);
|
int outlen;
|
||||||
|
WCHAR *widestr = (WCHAR *)enc_to_utf16(str, &inlen);
|
||||||
|
|
||||||
if (widestr != NULL)
|
if (widestr != NULL)
|
||||||
{
|
{
|
||||||
WideCharToMultiByte_alloc(GetConsoleCP(), 0, widestr, len,
|
WideCharToMultiByte_alloc(GetConsoleCP(), 0, widestr, inlen,
|
||||||
(LPSTR *)&ccp, &len, 0, 0);
|
(LPSTR *)&ccp, &outlen, 0, 0);
|
||||||
vim_free(widestr);
|
vim_free(widestr);
|
||||||
s = str = ccp;
|
s = str = ccp;
|
||||||
}
|
}
|
||||||
|
@@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
852,
|
||||||
/**/
|
/**/
|
||||||
851,
|
851,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user