[NOTEPAD] Use StringCchPrintf instead (#5654)

Use preferred string functions. CORE-18837
This commit is contained in:
Katayama Hirofumi MZ 2023-09-05 22:36:18 +09:00 committed by GitHub
parent eb6561bbc7
commit 3f921d1119
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -164,7 +164,7 @@ int DIALOG_StringMsgBox(HWND hParent, int formatId, LPCTSTR szString, DWORD dwFl
/* Load and format szMessage */
LoadString(Globals.hInstance, formatId, szResource, _countof(szResource));
_sntprintf(szMessage, _countof(szMessage), szResource, szString);
StringCchPrintf(szMessage, _countof(szMessage), szResource, szString);
/* Load szCaption */
if ((dwFlags & MB_ICONMASK) == MB_ICONEXCLAMATION)
@ -880,7 +880,7 @@ VOID DIALOG_StatusBarUpdateCaretPos(VOID)
line = SendMessage(Globals.hEdit, EM_LINEFROMCHAR, (WPARAM)dwStart, 0);
col = dwStart - SendMessage(Globals.hEdit, EM_LINEINDEX, (WPARAM)line, 0);
_stprintf(buff, Globals.szStatusBarLineCol, line + 1, col + 1);
StringCchPrintf(buff, _countof(buff), Globals.szStatusBarLineCol, line + 1, col + 1);
SendMessage(Globals.hStatusBar, SB_SETTEXT, SBPART_CURPOS, (LPARAM)buff);
}

View file

@ -202,7 +202,7 @@ BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert)
if (bShowAlert)
{
LoadString(Globals.hInstance, STRING_CANNOTFIND, szResource, _countof(szResource));
_sntprintf(szText, _countof(szText), szResource, pFindReplace->lpstrFindWhat);
StringCchPrintf(szText, _countof(szText), szResource, pFindReplace->lpstrFindWhat);
LoadString(Globals.hInstance, STRING_NOTEPAD, szResource, _countof(szResource));
MessageBox(Globals.hFindReplaceDlg, szText, szResource, MB_OK);
}