diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-01-11 16:03:38 +0100 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-01-15 10:57:22 +0100 |
commit | bc314f8e5f9b646e5ed09ccee2a2ddb012519305 (patch) | |
tree | 9267c8a58f29d0284c6ea050c24dffa3efea2d99 /cmd/part.c | |
parent | 504dbd224a5fd4f80b785e17c106ea738cd32cb4 (diff) |
cmd: part: list all 128 GPT partitions
A GPT partition table typically has 128 entries. If a partition table
contains a partition 128 'part list' should be able to list it.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'cmd/part.c')
-rw-r--r-- | cmd/part.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/part.c b/cmd/part.c index e0463b5a54..9d419c967c 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -89,10 +89,10 @@ static int do_part_list(int argc, char *const argv[]) if (var != NULL) { int p; - char str[512] = { '\0', }; + char str[3 * MAX_SEARCH_PARTITIONS] = { '\0', }; struct disk_partition info; - for (p = 1; p < MAX_SEARCH_PARTITIONS; p++) { + for (p = 1; p <= MAX_SEARCH_PARTITIONS; p++) { char t[5]; int r = part_get_info(desc, p, &info); |