Skip to content

Commit f84fdfe

Browse files
committed
Try tests with Cstring
1 parent c3900aa commit f84fdfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/zend/_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{ffi::c_void, ptr};
1+
use std::{ffi::{c_void, CString}, ptr};
22

33
use crate::{
44
ffi::{
@@ -80,7 +80,7 @@ impl ZendType {
8080
allow_null: bool,
8181
) -> Option<Self> {
8282
Some(Self {
83-
ptr: ZendStr::new(class_name, true).into_raw().as_ptr() as *mut c_void,
83+
ptr: CString::new(class_name).ok()?.into_raw() as *mut c_void,
8484
type_mask: _ZEND_TYPE_NAME_BIT
8585
| (if allow_null {
8686
_ZEND_TYPE_NULLABLE_BIT

0 commit comments

Comments
 (0)