From 98f5c30b05865738ae026e1ea7e4d55082577e61 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Mon, 14 Sep 2009 12:29:34 +0000 Subject: [PATCH] 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 --- rbutil/chinachippatcher/chinachip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;