Add tests for memcmp and fix a teeny tiny bug

This commit is contained in:
jD91mZM2
2018-10-09 16:47:57 +02:00
parent 3f4fbf9084
commit 0469c0c2c6
3 changed files with 37 additions and 18 deletions
+1 -1
View File
@@ -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);