summaryrefslogtreecommitdiffstats
path: root/common/ubiformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/ubiformat.c')
-rw-r--r--common/ubiformat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/ubiformat.c b/common/ubiformat.c
index e10ce31ce6..d8399ad9d6 100644
--- a/common/ubiformat.c
+++ b/common/ubiformat.c
@@ -444,7 +444,7 @@ static int format(struct ubiformat_args *args, struct mtd_info *mtd,
}
if (!args->quiet && !args->verbose)
- printf("\n");
+ printf("\rubiformat: formatted all eraseblocks -- 100 %% complete\n");
if (!novtbl) {
if (eb1 == -1 || eb2 == -1) {
@@ -745,6 +745,7 @@ int ubiformat_write(struct mtd_info *mtd, const void *buf, size_t count,
while (count) {
size_t now = mtd->erasesize - offset_in_peb;
+ int new_len;
if (now > count)
now = count;
@@ -780,7 +781,8 @@ int ubiformat_write(struct mtd_info *mtd, const void *buf, size_t count,
}
}
- ret = mtd_peb_write(mtd, buf, peb, offset_in_peb, now);
+ new_len = drop_ffs(mtd, buf, now);
+ ret = mtd_peb_write(mtd, buf, peb, offset_in_peb, new_len);
if (ret < 0)
return ret;