projects
/
coreboot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7250d9d
)
Print (empty) instead of nothing at all for empty
author
Maciej Pijanka
<maciej.pijanka@gmail.com>
Thu, 7 Jan 2010 21:37:18 +0000
(21:37 +0000)
committer
Patrick Georgi
<patrick.georgi@coresystems.de>
Thu, 7 Jan 2010 21:37:18 +0000
(21:37 +0000)
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
util/cbfstool/common.c
patch
|
blob
|
history
diff --git
a/util/cbfstool/common.c
b/util/cbfstool/common.c
index dd675cac03128392af2b4d2adeea824005bfe7ca..5fb4e4c392737badb6a3ac2ee8e82df76e4f2081 100644
(file)
--- 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 =