Skip to content

Commit 3dcce49

Browse files
authored
Merge pull request #301 from davidcole1340/revert-ctr-test
Try tests with Cstring
2 parents cb2afe9 + 7068a03 commit 3dcce49

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/zend/_type.rs

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

36
use crate::{
47
ffi::{
58
zend_type, IS_MIXED, MAY_BE_ANY, MAY_BE_BOOL, _IS_BOOL, _ZEND_IS_VARIADIC_BIT,
69
_ZEND_SEND_MODE_SHIFT, _ZEND_TYPE_NAME_BIT, _ZEND_TYPE_NULLABLE_BIT,
710
},
811
flags::DataType,
9-
types::ZendStr,
1012
};
1113

1214
/// Internal Zend type.
@@ -80,7 +82,7 @@ impl ZendType {
8082
allow_null: bool,
8183
) -> Option<Self> {
8284
Some(Self {
83-
ptr: ZendStr::new(class_name, true).into_raw().as_ptr() as *mut c_void,
85+
ptr: CString::new(class_name).ok()?.into_raw() as *mut c_void,
8486
type_mask: _ZEND_TYPE_NAME_BIT
8587
| (if allow_null {
8688
_ZEND_TYPE_NULLABLE_BIT

0 commit comments

Comments
 (0)