musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
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
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.c 2
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);
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月06日 23:21:34 +0000

AltStyle によって変換されたページ (->オリジナル) /