summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/ifdtool/ifdtool.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
index a59f36b886..0b6b210647 100644
--- a/util/ifdtool/ifdtool.c
+++ b/util/ifdtool/ifdtool.c
@@ -1358,11 +1358,12 @@ static void new_layout(const char *filename, char *image, int size,
if (new->size > current->size) {
/* copy from the end of the current region */
copy_size = current->size;
- offset_new = new->size - current->size;
+ if (i == REGION_BIOS)
+ offset_new = new->size - current->size;
}
- if (new->size < current->size) {
- /* copy to the end of the new region */
+ if ((i == REGION_BIOS) && (new->size < current->size)) {
+ /* copy BIOS region to the end of the new region */
offset_current = current->size - new->size;
}