Skip to content
Snippets Groups Projects
Commit 55bd1ada authored by Sebastian Würl's avatar Sebastian Würl
Browse files

stdlib: cleaner raw pointer handling in a64l

parent d4d808fc
No related branches found
No related tags found
No related merge requests found
......@@ -24,12 +24,13 @@ static mut ATEXIT_FUNCS: [Option<extern "C" fn()>; 32] = [None; 32];
#[no_mangle]
pub unsafe extern "C" fn a64l(s: *const c_char) -> c_long {
if s as isize == 0 {
if s.is_null() {
return 0;
}
let mut l: c_long = 0;
for x in 0..7 {
let c = *((s as isize + x) as *const c_char);
// a64l does not support more than 6 characters at once
for x in 0..6 {
let c = *s.offset(x);
if c == 0 {
// string is null terminated
return l;
......
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