From 09134d125e93a6ae1f7126ea3625437b9ae77573 Mon Sep 17 00:00:00 2001 From: anders_k Date: Fri, 6 Oct 2017 17:47:21 +0000 Subject: [PATCH] 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 --- Source/exehead/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/exehead/util.c b/Source/exehead/util.c index 5f13d19a..1aa46f79 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -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; }