summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-07-22 10:58:10 +0000
committerJay Freeman <saurik@saurik.com>2008-07-22 10:58:10 +0000
commitc23fa42841a858257db2cf87da06869980b8dc82 (patch)
tree65bbf06cfbabb188ae881b0d7e1635a02c265f9b
parente860dde099f7c1dca3e7a1dec41d912c4de8ac3c (diff)
Fixed a stupid bug in ldid that caused incorrect signatures occasionally.
git-svn-id: http://svn.telesphoreo.org/trunk@371 514c082c-b64e-11dc-b46d-3d985efe055d
-rw-r--r--util/ldid.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/ldid.cpp b/util/ldid.cpp
index 869e849fe..b58198845 100644
--- a/util/ldid.cpp
+++ b/util/ldid.cpp
@@ -498,7 +498,7 @@ int main(int argc, const char *argv[]) {
for (size_t i = 0; i != pages - 1; ++i)
sha1(hashes[i], top + 0x1000 * i, 0x1000);
if (pages != 0)
- sha1(hashes[pages - 1], top + 0x1000 * (pages - 1), data % 0x1000);
+ sha1(hashes[pages - 1], top + 0x1000 * (pages - 1), ((data - 1) % 0x1000) + 1);
}
}
@@ -553,7 +553,7 @@ int main(int argc, const char *argv[]) {
for (size_t i = 0; i != pages - 1; ++i)
sha1(hashes[i], top + 0x1000 * i, 0x1000);
if (pages != 0)
- sha1(hashes[pages - 1], top + 0x1000 * (pages - 1), data % 0x1000);
+ sha1(hashes[pages - 1], top + 0x1000 * (pages - 1), ((data - 1) % 0x1000) + 1);
directory->hashOffset = Swap(offset - begin);
offset += sizeof(*hashes) * pages;