summaryrefslogtreecommitdiff
path: root/cgpt
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@google.com>2012-07-30 15:05:59 -0700
committerGerrit <chrome-bot@google.com>2012-07-30 20:32:16 -0700
commit82bb80262e87d253731251f829471005e0b9d8e7 (patch)
treec8f7f9e74ea264b12a9e2b3ae9199eae4b49cc8f /cgpt
parent0c32130a57603fc6624c7fd285c71c851836f741 (diff)
downloadvboot-82bb80262e87d253731251f829471005e0b9d8e7.tar.gz
Fix "cgpt show" output for large hard drives.
"cgpt show" output table can be incorrect for large hard drives due to the number of digits in the start/size parameters. Fix by adding extra printf padding. BUG=chromium-os:33082 TEST=emerge, "cgpt show -q /dev/sda" on large HDD platform. Change-Id: I21008322739f5cd4a34372a4436a71259565c6e7 Reviewed-on: https://gerrit.chromium.org/gerrit/28730 Tested-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-by: Tammo Spalink <tammo@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Shawn Nematbakhsh <shawnn@chromium.org>
Diffstat (limited to 'cgpt')
-rw-r--r--cgpt/cgpt_show.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cgpt/cgpt_show.c b/cgpt/cgpt_show.c
index 681b0c7e..45837d97 100644
--- a/cgpt/cgpt_show.c
+++ b/cgpt/cgpt_show.c
@@ -44,11 +44,11 @@ static void RawDump(const uint8_t *memory, const int size,
}
/* Output formatters */
-#define TITLE_FMT "%10s%10s%8s %s\n"
-#define GPT_FMT "%10d%10d%8s %s\n"
-#define GPT_MORE "%10s%10s%8s ", "", "", ""
-#define PARTITION_FMT "%10d%10d%8d %s\n"
-#define PARTITION_MORE "%10s%10s%8s %s%s\n", "", "", ""
+#define TITLE_FMT "%12s%12s%8s %s\n"
+#define GPT_FMT "%12d%12d%8s %s\n"
+#define GPT_MORE "%12s%12s%8s ", "", "", ""
+#define PARTITION_FMT "%12d%12d%8d %s\n"
+#define PARTITION_MORE "%12s%12s%8s %s%s\n", "", "", ""
static void HeaderDetails(GptHeader *header, GptEntry *entries,
const char *indent, int raw) {