aboutsummaryrefslogtreecommitdiffstats
path: root/icemulti
diff options
context:
space:
mode:
authorRoland Lutz <rlutz@hedmen.org>2017-07-11 18:39:11 +0200
committerRoland Lutz <rlutz@hedmen.org>2017-09-04 20:13:03 +0200
commita622580c13a7cba2476c40ad87bf89ecca8cbed0 (patch)
tree88b1fd462be8b9d6880318c150401ae8e06556ba /icemulti
parent475cdba6dd195da0460c635ebd6ebd1df002cc38 (diff)
downloadicestorm-a622580c13a7cba2476c40ad87bf89ecca8cbed0.tar.gz
icestorm-a622580c13a7cba2476c40ad87bf89ecca8cbed0.tar.bz2
icestorm-a622580c13a7cba2476c40ad87bf89ecca8cbed0.zip
icemulti: Remove special first element from header lists
Diffstat (limited to 'icemulti')
-rw-r--r--icemulti/icemulti.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/icemulti/icemulti.cc b/icemulti/icemulti.cc
index ff55e99..bcf086a 100644
--- a/icemulti/icemulti.cc
+++ b/icemulti/icemulti.cc
@@ -189,7 +189,7 @@ int main(int argc, char **argv)
int image_count = 0;
int align_bits = 0;
bool align_first = false;
- Image *header_images[NUM_HEADERS];
+ Image *header_images[NUM_IMAGES];
std::unique_ptr<Image> images[NUM_IMAGES];
const char *outfile_name = NULL;
@@ -250,7 +250,7 @@ int main(int argc, char **argv)
if (header_count >= NUM_IMAGES)
error("Too many images supplied\n");
images[image_count].reset(new Image(argv[optind++]));
- header_images[header_count + 1] = &*images[image_count];
+ header_images[header_count] = &*images[image_count];
header_count++;
image_count++;
}
@@ -273,9 +273,8 @@ int main(int argc, char **argv)
}
// Populate headers
- header_images[0] = header_images[por_image + 1];
for (int i=header_count; i < NUM_IMAGES; i++)
- header_images[i + 1] = header_images[0];
+ header_images[i] = header_images[por_image];
std::ofstream ofs;
std::ostream *osp;
@@ -293,7 +292,10 @@ int main(int argc, char **argv)
for (int i=0; i<NUM_HEADERS; i++)
{
pad_to(*osp, file_offset, i * HEADER_SIZE);
- write_header(*osp, file_offset, header_images[i], i == 0 && coldboot);
+ if (i == 0)
+ write_header(*osp, file_offset, header_images[por_image], coldboot);
+ else
+ write_header(*osp, file_offset, header_images[i - 1], false);
}
for (int i=0; i<image_count; i++)
{