Skip to content

Commit 3a5d28f

Browse files
rlibc: fix bug in memcmp()
1 parent 343a52f commit 3a5d28f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librlibc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, n: uint) -> i32 {
9595
let a = *offset(s1, i as int);
9696
let b = *offset(s2, i as int);
9797
if a != b {
98-
return (a - b) as i32
98+
return a as i32 - b as i32
9999
}
100100
i += 1;
101101
}

0 commit comments

Comments
 (0)