diff options
Diffstat (limited to 'openpgp-ffi/src/common.rs')
-rw-r--r-- | openpgp-ffi/src/common.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openpgp-ffi/src/common.rs b/openpgp-ffi/src/common.rs index 72b60298..afb299b9 100644 --- a/openpgp-ffi/src/common.rs +++ b/openpgp-ffi/src/common.rs @@ -97,7 +97,7 @@ pub(crate) fn strndup(src: &[u8]) -> Option<*mut libc::c_char> { let s = unsafe { ::std::slice::from_raw_parts_mut(libc::malloc(l) as *mut u8, l) }; - &mut s[..l - 1].copy_from_slice(src); + s[..l - 1].copy_from_slice(src); s[l - 1] = 0; Some(s.as_mut_ptr() as *mut libc::c_char) |