align strings on 4 byte boundary and don't write NULL termination twice
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4931 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
fac39f2435
commit
e194176ec3
1 changed files with 2 additions and 6 deletions
|
@ -666,13 +666,9 @@ void CResourceEditor::WriteRsrcSec(BYTE* pbRsrcSec) {
|
|||
WORD iLen = winchar_strlen(szName) + 1;
|
||||
|
||||
*(WORD*)seeker = ConvertEndianness(iLen);
|
||||
seeker += sizeof(WORD);
|
||||
CopyMemory(seeker, szName, iLen*sizeof(WCHAR));
|
||||
seeker += iLen*sizeof(WCHAR);
|
||||
CopyMemory(seeker + sizeof(WORD), szName, iLen*sizeof(WCHAR));
|
||||
|
||||
// Even though the number of chars is predefined a null termination is required
|
||||
*(WORD*)seeker = 0;
|
||||
seeker += sizeof(WORD);
|
||||
seeker += RALIGN(iLen * sizeof(WCHAR) + sizeof(WORD), 4);
|
||||
|
||||
delete [] szName;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue