about summary refs log tree commit diff
path: root/src/string/strrchr.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-05-26 18:01:34 -0400
committerRich Felker <dalias@aerifal.cx>2012-05-26 18:01:34 -0400
commitaefd0f69bd22b825a6196e65b40a02e79fec23b5 (patch)
treee22dc9cbadfb354f998bee38f1716040680e4594 /src/string/strrchr.c
parent3f25354e624361f40011b242c492c2118184cc44 (diff)
downloadmusl-aefd0f69bd22b825a6196e65b40a02e79fec23b5.tar.gz
musl-aefd0f69bd22b825a6196e65b40a02e79fec23b5.tar.xz
musl-aefd0f69bd22b825a6196e65b40a02e79fec23b5.zip
fix failure of strrchr(str, 0)
bug report and solution by Richard Pennington
Diffstat (limited to 'src/string/strrchr.c')
-rw-r--r--src/string/strrchr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/strrchr.c b/src/string/strrchr.c
index 9c683087..635fb3c1 100644
--- a/src/string/strrchr.c
+++ b/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);
 }