Author: gschneider
Date: Wed Apr 14 22:43:23 2010
New Revision: 46873
URL:
http://svn.reactos.org/svn/reactos?rev=46873&view=rev
Log:
[NOTEPAD] Convert NULL characters to spaces when reading binary files
See issue #3573 for more details.
Modified:
trunk/reactos/base/applications/notepad/text.c
Modified: trunk/reactos/base/applications/notepad/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
==============================================================================
--- trunk/reactos/base/applications/notepad/text.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/notepad/text.c [iso-8859-1] Wed Apr 14 22:43:23 2010
@@ -51,7 +51,7 @@
{
DWORD dwSize;
LPBYTE pBytes = NULL;
- LPCWSTR pszText;
+ LPWSTR pszText;
LPWSTR pszAllocText = NULL;
DWORD dwPos, i;
DWORD dwCharCount;
@@ -110,7 +110,7 @@
/* fall through */
case ENCODING_UNICODE:
- pszText = (LPCWSTR) &pBytes[dwPos];
+ pszText = (LPWSTR) &pBytes[dwPos];
dwCharCount = (dwSize - dwPos) / sizeof(WCHAR);
break;
@@ -173,6 +173,10 @@
adwEolnCount[EOLN_CR]++;
else
adwEolnCount[EOLN_LF]++;
+ break;
+
+ case '\0':
+ pszText[i] = ' ';
break;
}
}