diff --git a/src/string/src/lib.rs b/src/string/src/lib.rs index 81e15e819fc660e7c5f40bb3ffac8f7775676035..962c8f761dfb3d3d1497b5ae180a1f3cdd77e8f1 100644 --- a/src/string/src/lib.rs +++ b/src/string/src/lib.rs @@ -259,7 +259,7 @@ pub unsafe extern "C" fn strrchr(s: *const c_char, c: c_int) -> *mut c_char { let len = strlen(s) as isize; let c = c as i8; let mut i = len - 1; - while *s.offset(i) != 0 && i >= 0 { + while i >= 0 { if *s.offset(i) == c { return s.offset(i) as *mut c_char; }