rollup merge of #19787: akiss77/fix-i8-c_char
On AArch64, libc::c_char is u8. There are some places in the code where i8 is assumed, which causes compilation errors. (AArch64 is not officially supported yet, but this change does not hurt any other targets and makes the code future-proof.)
This commit is contained in:
@@ -378,7 +378,7 @@ pub fn getenv_as_bytes(n: &str) -> Option<Vec<u8>> {
|
||||
if s.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some(CString::new(s as *const i8, false).as_bytes_no_nul().to_vec())
|
||||
Some(CString::new(s as *const libc::c_char, false).as_bytes_no_nul().to_vec())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user