From 5d2a98490e87872214e6acdeac1031c0eb8cfc92 Mon Sep 17 00:00:00 2001 From: Francesco Cosoleto Date: Thu, 26 May 2011 15:17:25 +0200 Subject: This adds a second parameter to size_to_human_string() to return a string with a different format based on the following flags: SIZE_SUFFIX_1LETTER = "1K" SIZE_SUFFIX_3LETTER = "1KiB", SIZE_SUFFIX_SPACE = "1 KiB" or "1 K" [kzak@redhat.com: - rename flags to SIZE_SUFFIX_* format, - fix suffix[] buffer size - add 3 letter version to the test] Signed-off-by: Francesco Cosoleto Signed-off-by: Karel Zak --- partx/partx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'partx/partx.c') diff --git a/partx/partx.c b/partx/partx.c index 5979701c5..8cb35703a 100644 --- a/partx/partx.c +++ b/partx/partx.c @@ -426,7 +426,7 @@ static void add_tt_line(struct tt *tt, blkid_partition par) rc = asprintf(&str, "%ju", (uintmax_t) blkid_partition_get_size(par) << 9); else - str = size_to_human_string( + str = size_to_human_string(SIZE_SUFFIX_1LETTER, blkid_partition_get_size(par) << 9); break; case COL_NAME: -- cgit v1.2.3-55-g7522