]> git.kaiwu.me - klib.git/commit
Fix ks_getuntil2() extra empty record at EOF bug
authorJohn Marshall <jm18@sanger.ac.uk>
Thu, 13 Nov 2014 14:28:46 +0000 (14:28 +0000)
committerJohn Marshall <jm18@sanger.ac.uk>
Thu, 13 Nov 2014 14:39:59 +0000 (14:39 +0000)
commitd60e5fc7199a212d77e9ac53d8a05fdbae983dc9
tree363c845c19ae891412401754b7803062eeaa869c
parentfa0868154277b603d656ce0c32be8e5ac94a1029
Fix ks_getuntil2() extra empty record at EOF bug

When the stream is an exact multiple of the buffer size, ks_getuntil2()
was returning a final empty record when it should have returned -1.
Fixed by moving the "EOF => return -1" check to after the read loop.

(See samtools/samtools#318 for an example of an error caused by a
spurious empty line at the end of a SAM file.)
kseq.h