diff --git a/client/fpga_compress.c b/client/fpga_compress.c index 2212265ad..53ab4b0b2 100644 --- a/client/fpga_compress.c +++ b/client/fpga_compress.c @@ -294,12 +294,16 @@ int main(int argc, char **argv) } else { num_input_files = argc-2; } + int adder = (hardnested_mode) ? 2 : 1; + infiles = calloc(num_input_files, sizeof(FILE*)); for (uint16_t i = 0; i < num_input_files; i++) { - infiles[i] = fopen(argv[i+hardnested_mode?2:1], "rb"); + infiles[i] = fopen(argv[i + adder ] , "rb"); if (infiles[i] == NULL) { - fprintf(stderr, "Error. Cannot open input file %s", argv[i+hardnested_mode?2:1]); + fprintf(stderr, "Error. Cannot open input file %s", argv[i + adder] ); return(EXIT_FAILURE); + } else { + printf("Opening %s %d \n", argv[i + adder], i+adder ); } } outfile = fopen(argv[argc-1], "wb");