summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-12-14 10:16:10 +0000
committerDave Chapman <dave@dchapman.com>2006-12-14 10:16:10 +0000
commitcd06755e04d059f60ee69dc0c416286cdfcee76f (patch)
tree5acf9219114ab895ac2265e32db60ee122785805 /tools
parent132b24163c555895263e1b55b1ed170bd04a55bb (diff)
downloadrockbox-cd06755e04d059f60ee69dc0c416286cdfcee76f.tar.gz
rockbox-cd06755e04d059f60ee69dc0c416286cdfcee76f.tar.bz2
rockbox-cd06755e04d059f60ee69dc0c416286cdfcee76f.zip
Use the correct length when extracting the firmware. Thanks again to Llorean for spotting.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11762 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/ipodpatcher/ipodpatcher.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/ipodpatcher/ipodpatcher.c b/tools/ipodpatcher/ipodpatcher.c
index fb563ac657..6fc1ce427d 100644
--- a/tools/ipodpatcher/ipodpatcher.c
+++ b/tools/ipodpatcher/ipodpatcher.c
@@ -570,14 +570,14 @@ int extract_firmware(HANDLE dh, char* filename, int start, int sector_size,
int2be(chksum,header);
memcpy(header+4,modelname,4);
- outfile = open(filename,O_CREAT|O_WRONLY|O_BINARY,0666);
+ outfile = open(filename,O_CREAT|O_TRUNC|O_WRONLY|O_BINARY,0666);
if (outfile < 0) {
fprintf(stderr,"[ERR] Couldn't open file %s\n",filename);
return -1;
}
write(outfile,header,8);
- write(outfile,sectorbuf,ipod_directory[0].len);
+ write(outfile,sectorbuf,length);
close(outfile);
return 0;