From a622580c13a7cba2476c40ad87bf89ecca8cbed0 Mon Sep 17 00:00:00 2001 From: Roland Lutz Date: Tue, 11 Jul 2017 18:39:11 +0200 Subject: icemulti: Remove special first element from header lists --- icemulti/icemulti.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'icemulti') 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 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