summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2015-09-20 18:52:15 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2015-09-20 18:52:15 -0700
commit672053357b3a7955fb09e039fc39af023d68d301 (patch)
tree5ec60b2ce9bf2703a8cb516d1726d3efa3d6c4cd
parente0098838fd5c18ddf447c4481320371da1cfe600 (diff)
downloadldid-672053357b3a7955fb09e039fc39af023d68d301.tar.gz
ldid-672053357b3a7955fb09e039fc39af023d68d301.tar.zst
ldid-672053357b3a7955fb09e039fc39af023d68d301.zip
Complete padding of final fat code directory blob.
-rw-r--r--ldid.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/ldid.cpp b/ldid.cpp
index 874e7f5..caf6bc1 100644
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -1119,10 +1119,11 @@ void resign(void *idata, size_t isize, std::streambuf &output, const Functor<siz
pad(output, allocation.limit_ - allocation.size_);
position += allocation.limit_ - allocation.size_;
- position += save(output, allocation.limit_, overlap, top);
- if (allocation.alloc_ > position)
- pad(output, allocation.alloc_ - position);
+ size_t saved(save(output, allocation.limit_, overlap, top));
+ if (allocation.alloc_ > saved)
+ pad(output, allocation.alloc_ - saved);
+ position += allocation.alloc_;
}
}