summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2018-03-31 15:24:02 -0300
committerSoniEx2 <endermoneymod@gmail.com>2018-03-31 15:24:02 -0300
commite4e7b29d09751195f369851eb0cea5fd6178ab16 (patch)
tree6b1b055d9be513a44b488b65f0a505d8abc46637
parent6dd8cc2dc4569766d573c21afa71632b7c8d0d96 (diff)
Fix incorrect usage of as_ptr
-rw-r--r--src/lib.rs4
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())
         }
     }