fix rounding error
authormbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 25 May 2005 18:31:13 +0000 (18:31 +0000)
committermbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 25 May 2005 18:31:13 +0000 (18:31 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1058 3c298f89-4303-0410-b956-a3cf2f4a3e73

openwrt/package/openwrt/jffs2root.c

index aa718da..36b928f 100644 (file)
@@ -99,7 +99,7 @@ int main(int argc, char **argv)
         printf("Partition already moved outside trx\n");
       } else {
        init_crc32();
         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));
        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));
This page took 0.024524 seconds and 4 git commands to generate.