mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:15:52 +00:00
[NOTEPAD] Convert NULL characters to spaces when reading binary files
See issue #3573 for more details. svn path=/trunk/; revision=46873
This commit is contained in:
parent
640fb7d222
commit
76a82f0995
1 changed files with 6 additions and 2 deletions
|
@ -51,7 +51,7 @@ BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding
|
|||
{
|
||||
DWORD dwSize;
|
||||
LPBYTE pBytes = NULL;
|
||||
LPCWSTR pszText;
|
||||
LPWSTR pszText;
|
||||
LPWSTR pszAllocText = NULL;
|
||||
DWORD dwPos, i;
|
||||
DWORD dwCharCount;
|
||||
|
@ -110,7 +110,7 @@ BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding
|
|||
/* fall through */
|
||||
|
||||
case ENCODING_UNICODE:
|
||||
pszText = (LPCWSTR) &pBytes[dwPos];
|
||||
pszText = (LPWSTR) &pBytes[dwPos];
|
||||
dwCharCount = (dwSize - dwPos) / sizeof(WCHAR);
|
||||
break;
|
||||
|
||||
|
@ -174,6 +174,10 @@ BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding
|
|||
else
|
||||
adwEolnCount[EOLN_LF]++;
|
||||
break;
|
||||
|
||||
case '\0':
|
||||
pszText[i] = ' ';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue