File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1006,7 +1006,7 @@ intptr_t NotepadPlusWrapper::getCurrentNativeLangEncoding()
10061006boost::python::str NotepadPlusWrapper::getLanguageName (int langType)
10071007{
10081008 int size = callNotepad (NPPM_GETLANGUAGENAME, langType, NULL );
1009- wchar_t * result (new wchar_t [size]);
1009+ wchar_t * result (new wchar_t [size+ 1 ]);
10101010 callNotepad (NPPM_GETLANGUAGENAME, langType, reinterpret_cast <LPARAM>(result));
10111011 std::shared_ptr<char > languageName = WcharMbcsConverter::tchar2char (result);
10121012 return boost::python::str (const_cast <const char *>(languageName.get ()));
@@ -1015,7 +1015,7 @@ boost::python::str NotepadPlusWrapper::getLanguageName(int langType)
10151015boost::python::str NotepadPlusWrapper::getLanguageDesc (int langType)
10161016{
10171017 int size = callNotepad (NPPM_GETLANGUAGEDESC, langType, NULL );
1018- wchar_t * result (new wchar_t [size]);
1018+ wchar_t * result (new wchar_t [size+ 1 ]);
10191019 callNotepad (NPPM_GETLANGUAGEDESC, langType, reinterpret_cast <LPARAM>(result));
10201020 std::shared_ptr<char > languageName = WcharMbcsConverter::tchar2char (result);
10211021 return boost::python::str (const_cast <const char *>(languageName.get ()));
You can’t perform that action at this time.
0 commit comments