aboutsummaryrefslogtreecommitdiff
path: root/tests/common/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common/mod.rs')
-rw-r--r--tests/common/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index d0f4ed8..810fd79 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -81,7 +81,7 @@ pub fn read_lines<'a, F: Read>(
None => true,
Some(mark) => buffer[..nbytes].windows(mark.len()).any(|w| w == mark),
};
- if pre_condition && &buffer[nbytes - 2..nbytes] == &b"\r\n"[..] {
+ if pre_condition && nbytes >= 2 && &buffer[nbytes - 2..nbytes] == &b"\r\n"[..] {
break;
}
}