anakryiko / btfdump

BTF introspection tool
BSD 2-Clause "Simplified" License
28 stars 7 forks source link

types: cast to arch-specific c_char instead of i8 #4

Closed anakryiko closed 1 year ago

anakryiko commented 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