Closed anakryiko closed 1 year ago
Seems like CStr::from_ptr is expecting a pointer to c_char, not i8 (as you could get from documentation at [0]). So cast to c_char to solve the problem.
[0] https://doc.rust-lang.org/std/ffi/struct.CStr.html#impl-CStr
Fixes: https://github.com/anakryiko/btfdump/issues/3
Seems like CStr::from_ptr is expecting a pointer to c_char, not i8 (as you could get from documentation at [0]). So cast to c_char to solve the problem.
[0] https://doc.rust-lang.org/std/ffi/struct.CStr.html#impl-CStr
Fixes: https://github.com/anakryiko/btfdump/issues/3