From f700f8af75a92c3d1c74fcf36e6558784a3f6cb3 Mon Sep 17 00:00:00 2001 From: pkubaj Date: Sun, 18 Sep 2022 16:38:48 +0000 Subject: [PATCH] Fix build on FreeBSD on ARM or POWER They use unsigned char. --- src/bsd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bsd.rs b/src/bsd.rs index a68d24d..34aae11 100644 --- a/src/bsd.rs +++ b/src/bsd.rs @@ -35,7 +35,7 @@ pub fn get_executable_path() -> Option { // FreeBSD without procfs if result == 0 { // Convert the string allocated on the stack to a Rust string. - let len = unsafe { strlen(buf.as_ptr() as *const i8) }; + let len = unsafe { strlen(buf.as_ptr() as *const libc::c_char) }; unsafe { buf.set_len(len) }; match String::from_utf8(buf).ok() { Some(path) => {