From: Mike Baker Date: Wed, 25 May 2005 18:31:13 +0000 (+0000) Subject: fix rounding error X-Git-Tag: whiterussian_rc1~168 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ce095ae248056d88e1586ea8276b4017706b9449;p=openwrt%2Fsvn-archive%2Fopenwrt.git fix rounding error SVN-Revision: 1058 --- diff --git a/openwrt/package/openwrt/jffs2root.c b/openwrt/package/openwrt/jffs2root.c index aa718da593..36b928ff46 100644 --- a/openwrt/package/openwrt/jffs2root.c +++ b/openwrt/package/openwrt/jffs2root.c @@ -99,7 +99,7 @@ int main(int argc, char **argv) printf("Partition already moved outside trx\n"); } else { init_crc32(); - ptr->offsets[2] += mtdInfo.erasesize; + ptr->offsets[2] += (mtdInfo.erasesize - 1); ptr->offsets[2] &= ~(mtdInfo.erasesize - 1); ptr->len = ptr->offsets[2]; ptr->crc32 = crc32buf((void *) &(ptr->flag_version), ptr->len - offsetof(struct trx_header, flag_version));