Commit eeb0062f authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

The BOM doesn't need a DWORD sized variable, only a WCHAR one.

Don't increment the szFile pointer since we removed the BOM earlier and it will cause the first real character of the INI file to be skipped.
parent f42fac55
...@@ -132,7 +132,7 @@ static inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len) ...@@ -132,7 +132,7 @@ static inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len)
static inline void PROFILE_WriteMarker(HANDLE hFile, ENCODING encoding) static inline void PROFILE_WriteMarker(HANDLE hFile, ENCODING encoding)
{ {
DWORD dwBytesWritten; DWORD dwBytesWritten;
DWORD bom; WCHAR bom;
switch (encoding) switch (encoding)
{ {
case ENCODING_ANSI: case ENCODING_ANSI:
...@@ -373,12 +373,12 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) ...@@ -373,12 +373,12 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
break; break;
case ENCODING_UTF16LE: case ENCODING_UTF16LE:
TRACE("UTF16 Little Endian encoding\n"); TRACE("UTF16 Little Endian encoding\n");
szFile = (WCHAR *)pBuffer + 1; szFile = (WCHAR *)pBuffer;
szEnd = (WCHAR *)((char *)pBuffer + dwFileSize); szEnd = (WCHAR *)((char *)pBuffer + dwFileSize);
break; break;
case ENCODING_UTF16BE: case ENCODING_UTF16BE:
TRACE("UTF16 Big Endian encoding\n"); TRACE("UTF16 Big Endian encoding\n");
szFile = (WCHAR *)pBuffer + 1; szFile = (WCHAR *)pBuffer;
szEnd = (WCHAR *)((char *)pBuffer + dwFileSize); szEnd = (WCHAR *)((char *)pBuffer + dwFileSize);
PROFILE_ByteSwapShortBuffer(szFile, dwFileSize / sizeof(WCHAR)); PROFILE_ByteSwapShortBuffer(szFile, dwFileSize / sizeof(WCHAR));
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment