[BUG_FIXED] (Author: Christian Cuvier) Fix crashes on new 11 character long UDL names bug.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@637 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2010-06-29 23:43:44 +00:00
parent 3c7a885a89
commit 4703502783

View File

@ -1660,7 +1660,7 @@ BOOL CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM
TCHAR *tmpName = (TCHAR *)strDlg.doDialog();
//const TCHAR *newName = newNameString.c_str();
if (tmpName)
if (tmpName && tmpName[0])
{
generic_string newNameString(tmpName);
const TCHAR *newName = newNameString.c_str();
@ -1883,7 +1883,10 @@ BOOL CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
{
case IDOK :
{
::GetDlgItemText(_hSelf, IDC_STRING_EDIT, (LPTSTR)_textValue.c_str(), 256);
TCHAR tmpName[langNameLenMax];
tmpName[0] = '\0';
::GetDlgItemText(_hSelf, IDC_STRING_EDIT, (LPTSTR)tmpName, langNameLenMax);
_textValue = tmpName;
::EndDialog(_hSelf, int(_textValue.c_str()));
return TRUE;
}