fix failure of strrchr(str, 0)
authorRich Felker <dalias@aerifal.cx>
Sat, 26 May 2012 22:01:34 +0000 (18:01 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 26 May 2012 22:01:34 +0000 (18:01 -0400)
bug report and solution by Richard Pennington

src/string/strrchr.c

index 9c68308..635fb3c 100644 (file)
@@ -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);
 }