diff options
author | Maciej Pijanka <maciej.pijanka@gmail.com> | 2010-01-07 21:37:18 +0000 |
---|---|---|
committer | Patrick Georgi <patrick.georgi@coresystems.de> | 2010-01-07 21:37:18 +0000 |
commit | f44eb7876b79787f5439767921419af23b8860f1 (patch) | |
tree | e7036566bc6b9ad96f1b4f9aa755f95bc3caab1f | |
parent | 7250d9d00e9bfb4a85a43423f37e2e95077a8b1f (diff) |
Print (empty) instead of nothing at all for empty
filename entries (particularily "null" files)
Signed-off-by: Maciej Pijanka <maciej.pijanka@gmail.com>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5004 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | util/cbfstool/common.c | 8 |
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 = |