Browse Source

fix failure of strrchr(str, 0)

bug report and solution by Richard Pennington
Rich Felker 12 years ago
parent
commit
aefd0f69bd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/string/strrchr.c

+ 1 - 1
src/string/strrchr.c

@@ -4,5 +4,5 @@ void *__memrchr(const void *, int, size_t);
 
 char *strrchr(const char *s, int c)
 {
-	return __memrchr(s, c, strlen(s));
+	return __memrchr(s, c, strlen(s) + 1);
 }