[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:
Gregor Schneider 2010-04-14 20:43:23 +00:00
parent 640fb7d222
commit 76a82f0995

View file

@ -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;
}
}