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

commit f3af9cfcf12be8673a227ac2231ecf7b8ceec28b
Author:     Serge Gautherie <[email protected]>
AuthorDate: Wed Nov 20 18:42:04 2019 +0100
Commit:     Hermès BÉLUSCA - MAÏTO <[email protected]>
CommitDate: Wed Nov 20 18:42:04 2019 +0100

    [NOTEPAD] StringCbPrintf() need sizeof(), not ARRAY_SIZE() (#2067)
---
 base/applications/notepad/dialog.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/base/applications/notepad/dialog.c 
b/base/applications/notepad/dialog.c
index d3b5deeea8a..f69773e3b04 100644
--- a/base/applications/notepad/dialog.c
+++ b/base/applications/notepad/dialog.c
@@ -81,13 +81,16 @@ void UpdateWindowCaption(BOOL clearModifyAlert)
     /* When a file is being opened or created, there is no need to have the 
edited flag shown
        when the new or opened file has not been edited yet */
     if (clearModifyAlert)
-        StringCbPrintf(szCaption, ARRAY_SIZE(szCaption), _T("%s - %s"), 
szFilename, szNotepad);
+    {
+        StringCbPrintf(szCaption, sizeof(szCaption), _T("%s - %s"),
+                       szFilename, szNotepad);
+    }
     else
     {
         BOOL isModified = (SendMessage(Globals.hEdit, EM_GETMODIFY, 0, 0) ? 
TRUE : FALSE);
 
         /* Update the caption based upon if the user has modified the contents 
of the file or not */
-        StringCbPrintf(szCaption, ARRAY_SIZE(szCaption), _T("%s%s - %s"),
+        StringCbPrintf(szCaption, sizeof(szCaption), _T("%s%s - %s"),
             (isModified ? _T("*") : _T("")), szFilename, szNotepad);
     }
 

Reply via email to