fix mount() not converting data to CString
This commit is contained in:
parent
17a3f77733
commit
46b1ab1dd8
|
@ -36,7 +36,13 @@ pub fn mount(
|
||||||
target = target.display()
|
target = target.display()
|
||||||
))?;
|
))?;
|
||||||
let fstype_cs = CString::new(fstype).context(format_args!("bad fstype: {fstype}"))?;
|
let fstype_cs = CString::new(fstype).context(format_args!("bad fstype: {fstype}"))?;
|
||||||
let data_ptr = if let Some(s) = data {
|
|
||||||
|
let data_cs = data
|
||||||
|
.map(CString::new)
|
||||||
|
.transpose()
|
||||||
|
.context(format_args!("bad data: {data:?}"))?;
|
||||||
|
|
||||||
|
let data_ptr = if let Some(s) = data_cs {
|
||||||
s.as_ptr()
|
s.as_ptr()
|
||||||
} else {
|
} else {
|
||||||
std::ptr::null()
|
std::ptr::null()
|
||||||
|
|
Loading…
Reference in New Issue