Skip to content

Commit f120913

Browse files
committed
Revert nul termination for Encoding.
This reverts commit b2f4a3f08e7ae288a42bc22a4189a3cc4c53cee2.
1 parent e941084 commit f120913

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::ffi::CStr;
1+
use std::ffi::{CStr, CString};
22
use std::marker::PhantomData;
33
use std::mem;
44
use std::str;
@@ -31,7 +31,7 @@ pub trait INSValue : INSObject {
3131

3232
fn from_value(value: Self::Value) -> Id<Self> {
3333
let cls = Self::class();
34-
let encoding = Self::Value::encode();
34+
let encoding = CString::new(Self::Value::encode().as_str()).unwrap();
3535
unsafe {
3636
let obj: *mut Self = msg_send![cls, alloc];
3737
let obj: *mut Self = msg_send![obj, initWithBytes:&value

0 commit comments

Comments
 (0)