(p: *const libc::c_char, vm: &VirtualMachine)
| 3409 | } |
| 3410 | |
| 3411 | fn ptr_to_str<'a>(p: *const libc::c_char, vm: &VirtualMachine) -> PyResult<&'a str> { |
| 3412 | if p.is_null() { |
| 3413 | return Err(vm.new_memory_error("string pointer is null")); |
| 3414 | } |
| 3415 | unsafe { CStr::from_ptr(p).to_str() } |
| 3416 | .map_err(|_| vm.new_value_error("Invalid UIF-8 codepoint")) |
| 3417 | } |
| 3418 | |
| 3419 | fn ptr_to_string( |
| 3420 | p: *const u8, |
no test coverage detected