diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2018-03-31 15:24:02 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2018-03-31 15:24:02 -0300 |
commit | e4e7b29d09751195f369851eb0cea5fd6178ab16 (patch) | |
tree | 6b1b055d9be513a44b488b65f0a505d8abc46637 /src | |
parent | 6dd8cc2dc4569766d573c21afa71632b7c8d0d96 (diff) |
Fix incorrect usage of as_ptr
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs index 0bc0f6d..617563a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -663,8 +663,10 @@ impl<'a> EnsureValidContext<'a> { pub fn command(self, cmd: &str) { // this was a mistake but oh well let ph = self.ph.ph; + // need to put this in a more permanent position than temporaries + let cmd = CString::new(cmd).unwrap(); unsafe { - ((*ph).hexchat_command)(ph, CString::new(cmd).unwrap().as_ptr()) + ((*ph).hexchat_command)(ph, cmd.as_ptr()) } } |