From f44eb7876b79787f5439767921419af23b8860f1 Mon Sep 17 00:00:00 2001 From: Maciej Pijanka Date: Thu, 7 Jan 2010 21:37:18 +0000 Subject: Print (empty) instead of nothing at all for empty filename entries (particularily "null" files) Signed-off-by: Maciej Pijanka Acked-by: Patrick Georgi git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5004 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/cbfstool/common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'util/cbfstool') 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 = -- cgit v1.2.3