Skip to content

Commit ccded19

Browse files
bugfix: failure when names lack spaces as default condition of not finding space had a bug in identifying where to break the line
1 parent a58b87a commit ccded19

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ impl FQRec {
229229

230230
// Set cursor just at the end of the read name (first
231231
// space/tab/newline)
232-
let mut cursor = self.n
233-
+ match &buf[self.n..self.r].iter().position(|&x| x == b' ') {
234-
Some(x) => x,
235-
_ => &self.r,
232+
let mut cursor =
233+
match &buf[self.n..(self.r - 1)].iter().position(|&x| x == b' ') {
234+
Some(x) => x + self.n,
235+
_ => self.r - 1,
236236
};
237237
unsafe {
238238
*b.add(cursor) = b'\n';

0 commit comments

Comments
 (0)