diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 4cd57bf422c4..0bb655c3f796 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -668,7 +668,7 @@ pure fn eq_slice(a: &str, b: &str) -> bool { unsafe { libc::memcmp(ap as *libc::c_void, bp as *libc::c_void, - alen as libc::size_t) == 0 + (alen - 1) as libc::size_t) == 0 } } }