Skip to content

Commit

Permalink
tmppanel: fix #2518 (missing null-terminator) + minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
spnethw committed Nov 28, 2024
1 parent 63ae9f6 commit 40978cd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tmppanel/src/TmpPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ SHAREDSYMBOL HANDLE WINAPI EXP_NAME(OpenPlugin)(int OpenFrom, INT_PTR Item)

StrBuf tmpTMP(k + 1);
TCHAR *TMP = tmpTMP;
lstrcpyn(TMP, argv - k, k + 1);
lstrcpyn(TMP, argv - k, k);
TMP[k] = L'\0';

for (int i = 0; i < OPT_COUNT; i++)
if (lstrcmpi(TMP + 1, ParamsStr[i]) == 0)
for (int i = 0; i < OPT_COUNT; i++) {
if (lstrcmpi(TMP + 1, ParamsStr[i]) == 0) {
*(int *)ParamsOpt[i] = *TMP == _T('+');
break;
}
}

if (*(TMP + 1) >= _T('0') && *(TMP + 1) <= _T('9'))
CurrentCommonPanel = *(TMP + 1) - _T('0');
Expand Down

0 comments on commit 40978cd

Please sign in to comment.