summaryrefslogtreecommitdiff
path: root/util/cbfstool
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool')
-rw-r--r--util/cbfstool/common.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index dd675cac03..5fb4e4c392 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -165,9 +165,11 @@ void print_cbfs_directory(const char *filename)
struct cbfs_file *thisfile =
(struct cbfs_file *)phys_to_virt(current);
uint32_t length = ntohl(thisfile->len);
- printf("%-30s 0x%-8x %-12s %d\n",
- (const char *)(phys_to_virt(current) +
- sizeof(struct cbfs_file)),
+ char *fname = (char *)(phys_to_virt(current) + sizeof(struct cbfs_file));
+ if (strlen(fname) == 0)
+ fname = "(empty)";
+
+ printf("%-30s 0x%-8x %-12s %d\n", fname,
current - phys_start, strfiletype(ntohl(thisfile->type)),
length);
current =