We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0da77f commit 7c7d896Copy full SHA for 7c7d896
profiling/src/timeline.rs
@@ -204,14 +204,7 @@ unsafe extern "C" fn ddog_php_prof_zend_error_observer(
204
}
205
206
#[cfg(zend_error_observer_80)]
207
- let file = unsafe {
208
- let mut len = 0;
209
- let file = file as *const u8;
210
- while *file.add(len) != 0 {
211
- len += 1;
212
- }
213
- std::str::from_utf8_unchecked(std::slice::from_raw_parts(file, len)).to_string()
214
- };
+ let file = unsafe { zend::zai_str_from_cstr(file.as_mut()).into_string() };
215
#[cfg(not(zend_error_observer_80))]
216
let file = unsafe { zend::zai_str_from_zstr(file.as_mut()).into_string() };
217
0 commit comments