From 61611f5b85475a94a4d8e10620ed5736034111bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Frederik=20M=C3=B6llers?= Date: Wed, 24 Jun 2015 14:57:08 +0200 Subject: [PATCH 1/1] Fix comparison error in fpga_compress The comparison would check for greater-than-or-equal the maximum amount of bytes to read/write when it should check for greater-than only. --- client/fpga_compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/fpga_compress.c b/client/fpga_compress.c index f7333b36..5c168292 100644 --- a/client/fpga_compress.c +++ b/client/fpga_compress.c @@ -96,7 +96,7 @@ int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile) } } - if (i >= num_infiles * FPGA_CONFIG_SIZE) { + if (i > num_infiles * FPGA_CONFIG_SIZE) { fprintf(stderr, "Input files too big (total > %lu bytes). These are probably not PM3 FPGA config files.", num_infiles*FPGA_CONFIG_SIZE); for(uint16_t j = 0; j < num_infiles; j++) { fclose(infile[j]); -- 2.39.5