Fix incorrect usage of as_ptr
This commit is contained in:
parent
6dd8cc2dc4
commit
e4e7b29d09
|
@ -663,8 +663,10 @@ impl<'a> EnsureValidContext<'a> {
|
||||||
pub fn command(self, cmd: &str) {
|
pub fn command(self, cmd: &str) {
|
||||||
// this was a mistake but oh well
|
// this was a mistake but oh well
|
||||||
let ph = self.ph.ph;
|
let ph = self.ph.ph;
|
||||||
|
// need to put this in a more permanent position than temporaries
|
||||||
|
let cmd = CString::new(cmd).unwrap();
|
||||||
unsafe {
|
unsafe {
|
||||||
((*ph).hexchat_command)(ph, CString::new(cmd).unwrap().as_ptr())
|
((*ph).hexchat_command)(ph, cmd.as_ptr())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue