summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgpt/cgpt_show.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cgpt/cgpt_show.c b/cgpt/cgpt_show.c
index 351c9cef..e80567c3 100644
--- a/cgpt/cgpt_show.c
+++ b/cgpt/cgpt_show.c
@@ -232,9 +232,14 @@ int CgptShow(CgptShowParams *params) {
case 'b':
printf("%" PRId64 "\n", entry->starting_lba);
break;
- case 's':
- printf("%" PRId64 "\n", entry->ending_lba - entry->starting_lba + 1);
+ case 's': {
+ uint64_t size = 0;
+ // If these aren't actually defined, don't show anything
+ if (entry->ending_lba || entry->starting_lba)
+ size = entry->ending_lba - entry->starting_lba + 1;
+ printf("%" PRId64 "\n", size);
break;
+ }
case 't':
GuidToStr(&entry->type, buf, sizeof(buf));
printf("%s\n", buf);