소스 검색

Update lib.rs

Justin Raymond 7 년 전
부모
커밋
63ee4de162
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/string/src/lib.rs

+ 1 - 1
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;
         }