We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 790ecd9 commit 8cfc8a5Copy full SHA for 8cfc8a5
psx/src/std.rs
@@ -34,7 +34,7 @@ impl<T: AsRef<[u8]>> AsCStr for T {
34
let mut uninitialized = MaybeUninit::uninit_array::<MAX_LEN>();
35
// Initialize the CStr with the input string
36
let initialized_part = &mut uninitialized[0..slice.len() + 1];
37
- MaybeUninit::write_slice(&mut initialized_part[0..slice.len()], slice);
+ MaybeUninit::copy_from_slice(&mut initialized_part[0..slice.len()], slice);
38
// Add a null-terminator to the CStr
39
initialized_part[slice.len()].write(0);
40
// SAFETY: The initialized portion of the CStr on the stack was explicitly
0 commit comments