Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 61d1511

Browse files
geofftalex
andauthored
WIP: json-sysctl: fix read
Co-Authored-By: Alex Gaynor <alex.gaynor@gmail.com>
1 parent b22b8b4 commit 61d1511

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/json-sysctl/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl linux_kernel_module::chrdev::FileOperations for JsonChrdev {
3737
};
3838
let mut s = serde_json_core::to_string::<typenum::U32, _>(&o).map_err(|_| error::Error::ENOMEM)?;
3939
s.push_str("\n").map_err(|_| error::Error::ENOMEM)?;
40-
buf.write(&s.into_bytes()[offset.try_into()?..])?;
40+
buf.write(&s.into_bytes()[offset.try_into()?..][..buf.len()])?;
4141
Ok(())
4242
}
4343
}

0 commit comments

Comments
 (0)