]> git.saurik.com Git - ldid.git/blobdiff - ldid.cpp
Complete padding of final fat code directory blob.
[ldid.git] / ldid.cpp
index 874e7f5fde82321063b3dda7584a604ab5625ef3..caf6bc1f09c01651379637a875030aef02fe5fe4 100644 (file)
--- 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_;
     }
 }