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

commit 361e0c72b8a2b69851459cfa872040a79e4a9dcb
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Tue Feb 14 13:25:44 2023 +0900
Commit:     Katayama Hirofumi MZ <[email protected]>
CommitDate: Tue Feb 14 13:25:44 2023 +0900

    [NOTEPAD] Follow-up of d3da0cb; *pBytes should be unsigned
    
    CORE-14641
---
 base/applications/notepad/text.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/base/applications/notepad/text.c b/base/applications/notepad/text.c
index 86b0fa78c37..f74fd01abd2 100644
--- a/base/applications/notepad/text.c
+++ b/base/applications/notepad/text.c
@@ -167,7 +167,7 @@ ProcessNewLinesAndNulls(HLOCAL *phLocal, LPWSTR *ppszText, 
SIZE_T *pcchText, EOL
 BOOL
 ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln)
 {
-    PCHAR pBytes = NULL;
+    LPBYTE pBytes = NULL;
     LPWSTR pszText, pszNewText = NULL;
     DWORD dwSize, dwPos;
     SIZE_T i, cchText, cbContent;
@@ -224,7 +224,7 @@ ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, 
EOLN *piEoln)
     }
     else
     {
-        encFile = AnalyzeEncoding((const char *)pBytes, dwSize);
+        encFile = AnalyzeEncoding((LPCSTR)pBytes, dwSize);
     }
 
     switch(encFile)
@@ -267,7 +267,7 @@ ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, 
EOLN *piEoln)
         cchText = 0;
         if (cbContent > 0)
         {
-            cchText = MultiByteToWideChar(iCodePage, 0, &pBytes[dwPos], 
(INT)cbContent, NULL, 0);
+            cchText = MultiByteToWideChar(iCodePage, 0, 
(LPCSTR)&pBytes[dwPos], (INT)cbContent, NULL, 0);
             if (cchText == 0)
                 goto done;
         }
@@ -282,8 +282,8 @@ ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, 
EOLN *piEoln)
         /* Do ANSI-to-Wide conversion */
         if (cbContent > 0)
         {
-            if (!MultiByteToWideChar(iCodePage, 0,
-                                     &pBytes[dwPos], (INT)cbContent, 
pszNewText, (INT)cchText))
+            if (!MultiByteToWideChar(iCodePage, 0, (LPCSTR)&pBytes[dwPos], 
(INT)cbContent,
+                                     pszNewText, (INT)cchText))
             {
                 goto done;
             }

Reply via email to