another 30 or so bytes saved, by modifying readSelfFile to do all length checking. Not sure if I broke anything though =)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1179 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
justin1014 2002-09-25 03:34:30 +00:00
parent 0728c9b4c8
commit 997ff07df8
4 changed files with 31 additions and 30 deletions

View file

@ -1345,13 +1345,13 @@ static int NSISCALL ExecuteEntry(entry *entry_)
if (hFile != INVALID_HANDLE_VALUE)
{
unsigned char *filebuf;
DWORD l;
filebuf=(unsigned char *)my_GlobalAlloc(g_filehdrsize);
if (filebuf)
{
int fixoffs=0;
DWORD lout;
SetSelfFilePointer(0,FILE_BEGIN);
ReadSelfFile((char*)filebuf,g_filehdrsize,&l);
ReadSelfFile((char*)filebuf,g_filehdrsize);
if (g_inst_header->uninstdata_offset != -1)
{
// Changed by Amir Szekely 11th July 2002
@ -1373,7 +1373,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
GlobalFree(unicon_data);
}
}
WriteFile(hFile,(char*)filebuf,g_filehdrsize,&l,NULL);
WriteFile(hFile,(char*)filebuf,g_filehdrsize,&lout,NULL);
GlobalFree(filebuf);
ret=GetCompressedDataFromDataBlock(-1,hFile);
}