Skip to content

Commit

Permalink
FreeBSD: accept *const i8/u8 for strlen arg
Browse files Browse the repository at this point in the history
Attempt to fix build on aarch64.
  • Loading branch information
surban committed Apr 3, 2024
1 parent 4b5a664 commit 4309e64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/target/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl NetworkInterfaceConfig for NetworkInterface {
/// Retrieves the network interface name
fn make_netifa_name(netifa: &libc::ifaddrs) -> Result<String> {
let data = netifa.ifa_name as *mut u8;
let len = unsafe { strlen(data as *const i8) };
let len = unsafe { strlen(data as *const _) };
let bytes_slice = unsafe { from_raw_parts(data, len) };
let string = String::from_utf8(bytes_slice.to_vec()).map_err(Error::from)?;

Expand Down

0 comments on commit 4309e64

Please sign in to comment.