From 33e1515662511c05c6e5905f075fe67010fc0bef Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sun, 4 Feb 2007 13:04:23 +0000 Subject: [PATCH] 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 --- tools/ipodpatcher/ipodpatcher.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;