git: f21faa67ab6b - main - makefs(8): do not print comma after the last super-block

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 05 Apr 2023 22:40:38 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=f21faa67ab6bfe1acb0073287396b232fb11d05e

commit f21faa67ab6bfe1acb0073287396b232fb11d05e
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2023-04-05 22:25:19 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-04-05 22:25:19 +0000

    makefs(8): do not print comma after the last super-block
    
    Reviewed by:    markj, emaste
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D39430
---
 usr.sbin/makefs/ffs/mkfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c
index 0f8b040d6997..ef745fe3c196 100644
--- a/usr.sbin/makefs/ffs/mkfs.c
+++ b/usr.sbin/makefs/ffs/mkfs.c
@@ -529,8 +529,9 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp)
 		initcg(cylno, tstamp, fsopts);
 		if (cylno % nprintcols == 0)
 			printf("\n");
-		printf(" %*lld,", printcolwidth,
-			(long long)fsbtodb(&sblock, cgsblock(&sblock, cylno)));
+		printf(" %*lld%s", printcolwidth,
+		    (long long)fsbtodb(&sblock, cgsblock(&sblock, cylno)),
+		    cylno == sblock.fs_ncg - 1 ? "" : ",");
 		fflush(stdout);
 	}
 	printf("\n");