Skip to content

Commit 21172ee

Browse files
apasel422brson
authored andcommitted
fix str::eq_slice off-by-one error
1 parent 2d690ae commit 21172ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ pure fn eq_slice(a: &str, b: &str) -> bool {
668668
unsafe {
669669
libc::memcmp(ap as *libc::c_void,
670670
bp as *libc::c_void,
671-
alen as libc::size_t) == 0
671+
(alen - 1) as libc::size_t) == 0
672672
}
673673
}
674674
}

0 commit comments

Comments
 (0)