From eeb0062fbb15afac8359411f32399cd8c76eed10 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 17 Nov 2005 11:05:46 +0000 Subject: [PATCH] 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. --- dlls/kernel/profile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/kernel/profile.c b/dlls/kernel/profile.c index b3a0678f8c9..b704dd0b31b 100644 --- a/dlls/kernel/profile.c +++ b/dlls/kernel/profile.c @@ -132,7 +132,7 @@ static inline void PROFILE_ByteSwapShortBuffer(WCHAR * buffer, int len) static inline void PROFILE_WriteMarker(HANDLE hFile, ENCODING encoding) { DWORD dwBytesWritten; - DWORD bom; + WCHAR bom; switch (encoding) { case ENCODING_ANSI: @@ -373,12 +373,12 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding) break; case ENCODING_UTF16LE: TRACE("UTF16 Little Endian encoding\n"); - szFile = (WCHAR *)pBuffer + 1; + szFile = (WCHAR *)pBuffer; szEnd = (WCHAR *)((char *)pBuffer + dwFileSize); break; case ENCODING_UTF16BE: TRACE("UTF16 Big Endian encoding\n"); - szFile = (WCHAR *)pBuffer + 1; + szFile = (WCHAR *)pBuffer; szEnd = (WCHAR *)((char *)pBuffer + dwFileSize); PROFILE_ByteSwapShortBuffer(szFile, dwFileSize / sizeof(WCHAR)); break;