Skip to content

Commit 7c7d896

Browse files
fix
1 parent b0da77f commit 7c7d896

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

profiling/src/timeline.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,7 @@ unsafe extern "C" fn ddog_php_prof_zend_error_observer(
204204
}
205205

206206
#[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-
};
207+
let file = unsafe { zend::zai_str_from_cstr(file.as_mut()).into_string() };
215208
#[cfg(not(zend_error_observer_80))]
216209
let file = unsafe { zend::zai_str_from_zstr(file.as_mut()).into_string() };
217210

0 commit comments

Comments
 (0)