We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3900aa commit f84fdfeCopy full SHA for f84fdfe
src/zend/_type.rs
@@ -1,4 +1,4 @@
1
-use std::{ffi::c_void, ptr};
+use std::{ffi::{c_void, CString}, ptr};
2
3
use crate::{
4
ffi::{
@@ -80,7 +80,7 @@ impl ZendType {
80
allow_null: bool,
81
) -> Option<Self> {
82
Some(Self {
83
- ptr: ZendStr::new(class_name, true).into_raw().as_ptr() as *mut c_void,
+ ptr: CString::new(class_name).ok()?.into_raw() as *mut c_void,
84
type_mask: _ZEND_TYPE_NAME_BIT
85
| (if allow_null {
86
_ZEND_TYPE_NULLABLE_BIT
0 commit comments