]> git.lizzy.rs Git - rust.git/commitdiff
fix str::eq_slice off-by-one error
authorAndrew Paseltiner <apaseltiner@gmail.com>
Mon, 3 Sep 2012 17:44:37 +0000 (13:44 -0400)
committerBrian Anderson <banderson@mozilla.com>
Tue, 4 Sep 2012 18:27:11 +0000 (11:27 -0700)
src/libcore/str.rs

index 4cd57bf422c4181e2a71d93c144a6fdbd2f6fafe..0bb655c3f7968575c3c011264ef8189c487a0206 100644 (file)
@@ -668,7 +668,7 @@ fn view_shift_char(s: &a/str) -> (char, &a/str) {
                 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
                 }
             }
         }