mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 17:01:28 +00:00
[NOTEPAD] Follow-up of d3da0cb; *pBytes should be unsigned
CORE-14641
This commit is contained in:
parent
d3da0cb7ed
commit
361e0c72b8
|
@ -167,7 +167,7 @@ ProcessNewLinesAndNulls(HLOCAL *phLocal, LPWSTR *ppszText, SIZE_T *pcchText, EOL
|
||||||
BOOL
|
BOOL
|
||||||
ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln)
|
ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln)
|
||||||
{
|
{
|
||||||
PCHAR pBytes = NULL;
|
LPBYTE pBytes = NULL;
|
||||||
LPWSTR pszText, pszNewText = NULL;
|
LPWSTR pszText, pszNewText = NULL;
|
||||||
DWORD dwSize, dwPos;
|
DWORD dwSize, dwPos;
|
||||||
SIZE_T i, cchText, cbContent;
|
SIZE_T i, cchText, cbContent;
|
||||||
|
@ -224,7 +224,7 @@ ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
encFile = AnalyzeEncoding((const char *)pBytes, dwSize);
|
encFile = AnalyzeEncoding((LPCSTR)pBytes, dwSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(encFile)
|
switch(encFile)
|
||||||
|
@ -267,7 +267,7 @@ ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln)
|
||||||
cchText = 0;
|
cchText = 0;
|
||||||
if (cbContent > 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)
|
if (cchText == 0)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -282,8 +282,8 @@ ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln)
|
||||||
/* Do ANSI-to-Wide conversion */
|
/* Do ANSI-to-Wide conversion */
|
||||||
if (cbContent > 0)
|
if (cbContent > 0)
|
||||||
{
|
{
|
||||||
if (!MultiByteToWideChar(iCodePage, 0,
|
if (!MultiByteToWideChar(iCodePage, 0, (LPCSTR)&pBytes[dwPos], (INT)cbContent,
|
||||||
&pBytes[dwPos], (INT)cbContent, pszNewText, (INT)cchText))
|
pszNewText, (INT)cchText))
|
||||||
{
|
{
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue