]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
Fix comparison error in fpga_compress 123/head
authorFrederik Möllers <frederikmoellers@posteo.de>
Wed, 24 Jun 2015 12:57:08 +0000 (14:57 +0200)
committerFrederik Möllers <frederikmoellers@posteo.de>
Wed, 24 Jun 2015 12:57:08 +0000 (14:57 +0200)
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

index f7333b369cf955f289b222178e567c720a7b2f7d..5c16829236f9298540c1e8e8a361fe23a93a14af 100644 (file)
@@ -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]);
Impressum, Datenschutz