Skip to content

Commit

Permalink
use ptr::cast
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxVerevkin committed Feb 23, 2024
1 parent b0ea1bd commit 4a6379c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn read_to_vec(fd: &mut impl AsFd, buf: &mut Vec<u8>) -> io::Result<usize> {
let res = unsafe {
libc::read(
fd.as_fd().as_raw_fd(),
buf.as_mut_ptr().add(buf.len()) as *mut libc::c_void,
buf.as_mut_ptr().add(buf.len()).cast(),
(buf.capacity() - buf.len()) as libc::size_t,
)
};
Expand Down

0 comments on commit 4a6379c

Please sign in to comment.