Skip to content

Commit

Permalink
Fixing the dst type, which is expected to be *mut i8:
Browse files Browse the repository at this point in the history
245 |                 std::ptr::copy_nonoverlapping(self.as_ptr().cast::<i8>(), dst, self.len());
    |                 -----------------------------                             ^^^ expected `*mut i8`, found `*mut u8`
    |                 |
    |                 arguments to this function are incorrect
  • Loading branch information
dmikushin committed Oct 25, 2024
1 parent a746684 commit bfd0cad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gentl/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl CopyTo for &str {
if *dst_size < string_len {
return Err(GenTlError::BufferTooSmall);
}
std::ptr::copy_nonoverlapping(self.as_ptr().cast::<i8>(), dst, self.len());
std::ptr::copy_nonoverlapping(self.as_ptr().cast::<i8>(), dst.cast::<i8>(), self.len());
dst.add(self.len()).write(0); // Null terminated.
}
}
Expand Down

0 comments on commit bfd0cad

Please sign in to comment.