Save a couple of bytes by comparing the UTF16LE BOM as a 16-bit number

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6920 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2017-10-06 17:47:21 +00:00
parent 9764f37904
commit 09134d125e

View file

@ -507,7 +507,7 @@ HRESULT NSISCALL UTF16LEBOM(HANDLE h, INT_PTR ForWrite)
if (0 == orgpos)
{
BYTE bom[2];
if (myReadFile(h, bom, 2) && (0xff == bom[0] && 0xfe == bom[1]))
if (myReadFile(h, bom, 2) && (0xfeff == *(UINT16*) &bom[0]))
{
return S_OK;
}