https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3f921d1119b295de31ee095dceaa62d6ce54ae69

commit 3f921d1119b295de31ee095dceaa62d6ce54ae69
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Tue Sep 5 22:36:18 2023 +0900
Commit:     GitHub <[email protected]>
CommitDate: Tue Sep 5 22:36:18 2023 +0900

    [NOTEPAD] Use StringCchPrintf instead (#5654)
    
    Use preferred string functions. CORE-18837
---
 base/applications/notepad/dialog.c | 4 ++--
 base/applications/notepad/main.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/applications/notepad/dialog.c 
b/base/applications/notepad/dialog.c
index 78dbd467f37..846a9abac57 100644
--- a/base/applications/notepad/dialog.c
+++ b/base/applications/notepad/dialog.c
@@ -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);
 }
 
diff --git a/base/applications/notepad/main.c b/base/applications/notepad/main.c
index c232bfbf3e7..a6477bfefd6 100644
--- a/base/applications/notepad/main.c
+++ b/base/applications/notepad/main.c
@@ -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);
         }

Reply via email to