From 6d9a03eb4f0f5c0b5f917d1092c4d851a392b9fb Mon Sep 17 00:00:00 2001
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Date: Fri, 16 Jan 2009 15:30:40 +0200
Subject: ubiformat: nicify error messages

In case of error, ubiformat prints error messages at the same
line as the previous messages. Fix this.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 ubi-utils/new-utils/src/ubiformat.c | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'ubi-utils')

diff --git a/ubi-utils/new-utils/src/ubiformat.c b/ubi-utils/new-utils/src/ubiformat.c
index 7a6d1b7..bf07e5e 100644
--- a/ubi-utils/new-utils/src/ubiformat.c
+++ b/ubi-utils/new-utils/src/ubiformat.c
@@ -506,6 +506,8 @@ static int format(const struct mtd_info *mtd, const struct ubigen_info *ui,
 
 		err = mtd_erase(mtd, eb);
 		if (err) {
+			if (!args.quiet)
+				printf("\n");
 			sys_errmsg("failed to erase eraseblock %d", eb);
 			goto out_free;
 		}
@@ -530,6 +532,8 @@ static int format(const struct mtd_info *mtd, const struct ubigen_info *ui,
 
 		err = mtd_write(mtd, eb, 0, hdr, write_size);
 		if (err) {
+			if (!args.quiet && !args.verbose)
+				printf("\n");
 			sys_errmsg("cannot write EC header (%d bytes buffer) to eraseblock %d",
 				   write_size, eb);
 			if (args.subpage_size != mtd->min_io_size)
-- 
cgit v1.2.3