summaryrefslogtreecommitdiffstats
path: root/rbutil/chinachippatcher/chinachip.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-09-14 12:29:34 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-09-14 12:29:34 +0000
commit98f5c30b05865738ae026e1ea7e4d55082577e61 (patch)
tree5051d8e91e95f626591da3e8b2dbf40984f914d0 /rbutil/chinachippatcher/chinachip.c
parent498043d552a3c587949cd33f8fed3b990a40e61f (diff)
downloadrockbox-98f5c30b05865738ae026e1ea7e4d55082577e61.tar.gz
rockbox-98f5c30b05865738ae026e1ea7e4d55082577e61.tar.bz2
rockbox-98f5c30b05865738ae026e1ea7e4d55082577e61.zip
Fix ccpmp.bin backup in ChinaChippatcher (thanks to Aaron DeMille)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22699 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/chinachippatcher/chinachip.c')
-rw-r--r--rbutil/chinachippatcher/chinachip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rbutil/chinachippatcher/chinachip.c b/rbutil/chinachippatcher/chinachip.c
index cafb1d189b..7237572fac 100644
--- a/rbutil/chinachippatcher/chinachip.c
+++ b/rbutil/chinachippatcher/chinachip.c
@@ -155,6 +155,7 @@ int chinachip_patch(const char* firmware, const char* bootloader,
if(ccpmp_backup)
{
+ int ccpmp_data_pos = ccpmp_pos + 9;
bd = fopen(ccpmp_backup, "wb");
if(!bd)
{
@@ -163,7 +164,7 @@ int chinachip_patch(const char* firmware, const char* bootloader,
}
INFO(tr("Writing %d bytes to %s..."), ccpmp_size, ccpmp_backup);
- if(fwrite(&buf[ccpmp_pos], ccpmp_size, 1, bd) != 1)
+ if(fwrite(&buf[ccpmp_data_pos], ccpmp_size, 1, bd) != 1)
{
ERR(tr("Can't write to file %s!"), ccpmp_backup);
goto err;