summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-02-04 13:04:23 +0000
committerDave Chapman <dave@dchapman.com>2007-02-04 13:04:23 +0000
commit33e1515662511c05c6e5905f075fe67010fc0bef (patch)
tree6b288933044c323e4bd17ebceb68f2cf1646f93e /tools
parent7ebb2911b820cbf942dafbeeded71e503d3bb44e (diff)
downloadrockbox-33e1515662511c05c6e5905f075fe67010fc0bef.tar.gz
rockbox-33e1515662511c05c6e5905f075fe67010fc0bef.tar.bz2
rockbox-33e1515662511c05c6e5905f075fe67010fc0bef.zip
Bugfix. ipodpatcher wasn't correctly deciding when to rearrange the contents of the firmware partition to make space for the bootloader. This bug was only hit when the amount of space required was less than 0x4400 bytes (17KB) - e.g. when upgrading an existing bootloader.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12193 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/ipodpatcher/ipodpatcher.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/ipodpatcher/ipodpatcher.c b/tools/ipodpatcher/ipodpatcher.c
index 7d71ac29e1..a7b441ae0d 100644
--- a/tools/ipodpatcher/ipodpatcher.c
+++ b/tools/ipodpatcher/ipodpatcher.c
@@ -548,7 +548,8 @@ int add_bootloader(struct ipod_t* ipod, char* filename, int type)
/* Check if we have enough space */
/* TODO: Check the size of the partition. */
if (ipod->nimages > 1) {
- if ((entryOffset+paddedlength) >= ipod->ipod_directory[1].devOffset) {
+ if ((ipod->ipod_directory[0].devOffset+entryOffset+paddedlength) >=
+ ipod->ipod_directory[1].devOffset) {
fprintf(stderr,"[INFO] Moving images to create room for new firmware...\n");
delta = ipod->ipod_directory[0].devOffset + entryOffset+paddedlength
- ipod->ipod_directory[1].devOffset;