Skip to content

Use libc c_char instead of i8 for libc strlen() call #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core-foundation/src/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::ptr;
use std::path::{Path, PathBuf};
use std::mem;

use libc::{strlen, PATH_MAX};
use libc::{c_char, strlen, PATH_MAX};

#[cfg(unix)]
use std::os::unix::ffi::OsStrExt;
Expand Down Expand Up @@ -83,7 +83,7 @@ impl CFURL {
if result == false as Boolean {
return None;
}
let len = strlen(buf.as_ptr() as *const i8);
let len = strlen(buf.as_ptr() as *const c_char);
let path = OsStr::from_bytes(&buf[0..len]);
Some(PathBuf::from(path))
}
Expand Down