3 ms·
There is a bug that causes invalid output when the input file is larger then the BLOCKLEN. Set BLOCKLEN to 4096 and run the program on the test input file [1]
by neopallium 14y ago
There is a bug that causes invalid output when the input file is larger then the BLOCKLEN. Set BLOCKLEN to 4096 and run the program on the test input file [1] (compare with output file [2]), to see the problem on a smaller input file.
The bug happens when read_sequence() is called with partial data saved from the last sequence, since (size == read) the first fread() will be asked for 0 bytes which causes the read loop to end early (n == 0).
1. http://benchmarksgame.alioth.debian.org/u32/iofile.php?test=revcomp&file=input http://benchmarksgame.alioth.debian.org/u32/iofile.php?test=...
2. http://benchmarksgame.alioth.debian.org/u32/iofile.php?test=revcomp&file=output http://benchmarksgame.alioth.debian.org/u32/iofile.php?test=...
- jacquesm 14y agoThat was a good catch! Serves me right for testing with the small file for correctness and testing for speed with the larger one.