Skip to content
Snippets Groups Projects
Verified Commit 94a6da91 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix lookahead buffer reading nul's

parent 07ec3b65
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,12 @@ struct LookAheadBuffer {
impl LookAheadBuffer {
fn look_ahead(&mut self) -> Result<Option<u8>, i32> {
let byte = unsafe { *self.buf.offset(self.look_ahead) };
self.look_ahead += 1;
Ok(Some(byte))
if byte == 0 {
Ok(None)
} else {
self.look_ahead += 1;
Ok(Some(byte))
}
}
fn commit(&mut self) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment