Fix shortcut name more than 64 characters makes an empty name issue

Fix #9556, close #9543
This commit is contained in:
QoL 2021-02-20 01:21:28 +02:00 committed by Don HO
parent f96d81af11
commit 26dad277c9
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ void Shortcut::setName(const TCHAR * menuName, const TCHAR * shortcutName)
lstrcpyn(_menuName, menuName, nameLenMax);
TCHAR const * name = shortcutName ? shortcutName : menuName;
int i = 0, j = 0;
while (name[j] != 0 && i < nameLenMax)
while (name[j] != 0 && i < (nameLenMax-1))
{
if (name[j] != '&')
{