diff options
Diffstat (limited to 'nand-utils')
-rw-r--r-- | nand-utils/nanddump.c | 5 | ||||
-rw-r--r-- | nand-utils/nandflipbits.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/nand-utils/nanddump.c b/nand-utils/nanddump.c index bc22858..b4de05e 100644 --- a/nand-utils/nanddump.c +++ b/nand-utils/nanddump.c @@ -102,6 +102,7 @@ static void process_options(int argc, char * const argv[]) { int error = 0; bool oob_default = true; + char *dumpfile_tmp = NULL; for (;;) { int option_index = 0; @@ -165,8 +166,8 @@ static void process_options(int argc, char * const argv[]) start_addr = simple_strtoll(optarg, &error); break; case 'f': - free(dumpfile); - dumpfile = xstrdup(optarg); + free(dumpfile_tmp); + dumpfile = dumpfile_tmp = xstrdup(optarg); break; case 'l': length = simple_strtoll(optarg, &error); diff --git a/nand-utils/nandflipbits.c b/nand-utils/nandflipbits.c index 7066408..a417189 100644 --- a/nand-utils/nandflipbits.c +++ b/nand-utils/nandflipbits.c @@ -251,7 +251,7 @@ int main(int argc, char **argv) bufoffs += mtd.min_io_size; ret = mtd_read_oob(mtd_desc, &mtd, fd, - bit_to_flip->block * mtd.eb_size + + (unsigned long long)bit_to_flip->block * mtd.eb_size + blkoffs, mtd.oob_size, buffer + bufoffs); if (ret) { |