Fix incorrect usage of as_ptr

This commit is contained in:
SoniEx2 2018-03-31 15:24:02 -03:00
parent 6dd8cc2dc4
commit e4e7b29d09
1 changed files with 3 additions and 1 deletions

View File

@ -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())
} }
} }