From 2c0e7ad0bdae277666854766fbc0a091e63de4cf Mon Sep 17 00:00:00 2001 From: anders_k Date: Sun, 9 Feb 2014 19:32:41 +0000 Subject: [PATCH] Calculate ctlcolors64 offset correctly git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6441 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/script.cpp b/Source/script.cpp index b18f31dc..16491350 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -4608,16 +4608,16 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) c.bkmode=OPAQUE; } - int i; - int l=cur_ctlcolors->getlen()/sizeof(ctlcolors); + assert(sizeof(ctlcolors64) > sizeof(ctlcolors)); + int i, l=cur_ctlcolors->getlen()/sizeof(ctlcolors), pad=is_target_64bit()?sizeof(ctlcolors64)-sizeof(ctlcolors):0; for (i=0; iget()+i,&c,sizeof(ctlcolors))) { - ent.offsets[1]=i*sizeof(ctlcolors); + ent.offsets[1]=i*(sizeof(ctlcolors)+pad); break; } } if (i>=l) { - ent.offsets[1]=cur_ctlcolors->add(&c,sizeof(ctlcolors)); + ent.offsets[1]=cur_ctlcolors->add(&c,sizeof(ctlcolors))+(l*pad); } SCRIPT_MSG(_T("SetCtlColors: hwnd=%") NPRIs _T(" %") NPRIs _T("text=%") NPRIs _T(" background=%") NPRIs _T("\n"),line.gettoken_str(1),a==2?_T(""):_T("/BRANDING "),line.gettoken_str(a),line.gettoken_str(a+1));