aboutsummaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfs_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/cbfs_image.c')
-rw-r--r--util/cbfstool/cbfs_image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index f93cfef71b..315cbe5573 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -533,7 +533,7 @@ static int cbfs_add_entry_at(struct cbfs_image *image,
int cbfs_add_entry(struct cbfs_image *image, struct buffer *buffer,
uint32_t content_offset,
- struct cbfs_file *header, uint32_t header_size)
+ struct cbfs_file *header)
{
assert(image);
assert(buffer);
@@ -546,6 +546,7 @@ int cbfs_add_entry(struct cbfs_image *image, struct buffer *buffer,
uint32_t addr, addr_next;
struct cbfs_file *entry, *next;
uint32_t need_size;
+ uint32_t header_size = ntohl(header->offset);
need_size = header_size + buffer->size;
DEBUG("cbfs_add_entry('%s'@0x%x) => need_size = %u+%zu=%u\n",