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()
|
||||
))?;
|
||||
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()
|
||||
} else {
|
||||
std::ptr::null()
|
||||
|
|
Loading…
Reference in New Issue