From 907953084042f60bed0698cf35b10771fd6c6bab Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 25 Mar 2006 19:43:25 +0000 Subject: [PATCH] big-endian compatibility for uninstall_generate git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4620 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/build.cpp b/Source/build.cpp index ace8ed43..6b9765dd 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -2926,7 +2926,11 @@ int CEXEBuild::uninstall_generate() MMapBuf udata; - udata.add(&fh, sizeof(fh)); + { + growbuf_writer_sink sink(&udata); + firstheader_writer w(&sink); + w.write(&fh); + } ubuild_datablock.setro(TRUE); @@ -2987,7 +2991,7 @@ int CEXEBuild::uninstall_generate() } firstheader *_fh=(firstheader *)udata.get(0, sizeof(firstheader)); - _fh->length_of_all_following_data=udata.getlen()+(build_crcchk?sizeof(int):0); + _fh->length_of_all_following_data=FIX_ENDIAN_INT32(udata.getlen()+(build_crcchk?sizeof(int):0)); udata.release(); } else @@ -3029,6 +3033,7 @@ int CEXEBuild::uninstall_generate() left -= l; } udata.setro(FALSE); + FIX_ENDIAN_INT32_INPLACE(crc); udata.add(&crc, sizeof(crc)); udata.setro(TRUE); }