From b968f8ed826b9cc662c1a484040c55b0e0ad18c4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 22 Sep 2024 00:17:14 +0200 Subject: Expose device information in confirmation prompt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- deadshred.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'deadshred.c') diff --git a/deadshred.c b/deadshred.c index 8b8a74c..baa7bf6 100644 --- a/deadshred.c +++ b/deadshred.c @@ -57,8 +57,8 @@ print_status(int done, struct status *s) libsimple_difftimespec(&time_spent, &s->now, &start_time); sprintf(bufi == 0 ? buf1 : buf2, - "%ji bytes (%s, %s, %.2lf %%) of %s (%s) shredded\033[K\n" - "failed writes: %ju; bad sections: %ju (%ji bytes, %s, %s)\033[K\n" + "%ji byte%s (%s, %s, %.2lf %%) of %s (%s) shredded\033[K\n" + "failed writes: %ju; bad sections: %ju (%ji byte%s, %s, %s)\033[K\n" "time spent shredding: %s; performance: %s\033[K\n" "time since last successful write: %s\033[K\n" "maximum time until a successful write: %s\033[K\n" @@ -66,6 +66,7 @@ print_status(int done, struct status *s) "%s", /* line 1 { */ (intmax_t)s->shredded, + s->shredded == 1 ? "" : "s", humansize1000(s->shredded, subbuf1), humansize1024(s->shredded, subbuf2), 100 * (double)s->shredded / (double)total_size, @@ -75,6 +76,7 @@ print_status(int done, struct status *s) s->bad_writes, s->bad_sections, (intmax_t)s->bad_bytes, + s->bad_bytes == 1 ? "" : "s", humansize1000(s->bad_bytes, subbuf3), humansize1024(s->bad_bytes, subbuf4), /* } line 3 { */ -- cgit v1.2.3-70-g09d2