Skip to content
Snippets Groups Projects
Commit 2751d457 authored by Alex Lyon's avatar Alex Lyon
Browse files

unistd: use .is_null() for pointers

parent 42a6693a
No related branches found
No related tags found
No related merge requests found
...@@ -30,12 +30,12 @@ pub unsafe extern "C" fn getopt( ...@@ -30,12 +30,12 @@ pub unsafe extern "C" fn getopt(
argv: *const *mut c_char, argv: *const *mut c_char,
optstring: *const c_char, optstring: *const c_char,
) -> c_int { ) -> c_int {
if CURRENT_OPT == ptr::null_mut() || *CURRENT_OPT == 0 { if CURRENT_OPT.is_null() || *CURRENT_OPT == 0 {
if optind >= argc { if optind >= argc {
-1 -1
} else { } else {
let current_arg = *argv.offset(optind as isize); let current_arg = *argv.offset(optind as isize);
if current_arg == ptr::null_mut() || *current_arg != b'-' as c_char if current_arg.is_null() || *current_arg != b'-' as c_char
|| string::strcmp(current_arg, b"-\0".as_ptr() as _) == 0 || string::strcmp(current_arg, b"-\0".as_ptr() as _) == 0
{ {
-1 -1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment