Revision: 10456 https://osdn.net/projects/ttssh2/scm/svn/commits/10456 Author: zmatsuo Date: 2023-01-06 23:00:28 +0900 (Fri, 06 Jan 2023) Log Message: ----------- 標準ログファイル名長を設定文字列長から決定するよう修正した Modified Paths: -------------- trunk/teraterm/teraterm/addsetting.cpp -------------- next part -------------- Modified: trunk/teraterm/teraterm/addsetting.cpp =================================================================== --- trunk/teraterm/teraterm/addsetting.cpp 2023-01-06 14:00:18 UTC (rev 10455) +++ trunk/teraterm/teraterm/addsetting.cpp 2023-01-06 14:00:28 UTC (rev 10456) @@ -1666,7 +1666,8 @@ if (wParam == (IDC_DEFAULTNAME_EDITOR | (CBN_SELCHANGE << 16))) { LRESULT r = SendDlgItemMessageW(IDC_DEFAULTNAME_EDITOR, CB_GETCURSEL, 0, 0); if (r != CB_ERR) { - format = (wchar_t*)malloc(50 * sizeof(wchar_t)); + LRESULT len = SendDlgItemMessageW(IDC_DEFAULTNAME_EDITOR, CB_GETLBTEXTLEN, r, 0); + format = (wchar_t*)malloc((len + 1) * sizeof(wchar_t)); SendDlgItemMessageW(IDC_DEFAULTNAME_EDITOR, CB_GETLBTEXT, r, (LPARAM)format); } }