Add tests for memcmp and fix a teeny tiny bug
This commit is contained in:
@@ -95,7 +95,7 @@ pub unsafe extern "C" fn memcmp(s1: *const c_void, s2: *const c_void, n: usize)
|
||||
let mut b = b as *const u8;
|
||||
for _ in 0..rem {
|
||||
if *a != *b {
|
||||
return a as c_int - b as c_int;
|
||||
return *a as c_int - *b as c_int;
|
||||
}
|
||||
a = a.offset(1);
|
||||
b = b.offset(1);
|
||||
|
||||
Reference in New Issue
Block a user