about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorIlya Dmitrichenko <ilya@xively.com>2014-07-20 14:05:28 +0100
committerAlex Crichton <alex@alexcrichton.com>2014-07-21 09:54:23 -0700
commitfcaee85ced65fae0aad4249e19ec85cbffd4d21c (patch)
tree299faa627b4ae8469b66d8355211e67fb8c30bb6 /src
parenta491551597c4eff030e3f64158569de4de71292a (diff)
downloadrust-fcaee85ced65fae0aad4249e19ec85cbffd4d21c.tar.gz
rust-fcaee85ced65fae0aad4249e19ec85cbffd4d21c.zip
rlibc: fix bug in `memcmp()`
Diffstat (limited to 'src')
-rw-r--r--src/librlibc/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librlibc/lib.rs b/src/librlibc/lib.rs
index cb27596c98c..3e45964cd12 100644
--- a/src/librlibc/lib.rs
+++ b/src/librlibc/lib.rs
@@ -95,7 +95,7 @@ pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, n: uint) -> i32 {
         let a = *offset(s1, i as int);
         let b = *offset(s2, i as int);
         if a != b {
-            return (a - b) as i32
+            return a as i32 - b as i32
         }
         i += 1;
     }