summaryrefslogtreecommitdiff
path: root/lib/string/strrchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/string/strrchr.c')
-rw-r--r--lib/string/strrchr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/string/strrchr.c b/lib/string/strrchr.c
new file mode 100644
index 0000000..a45b459
--- /dev/null
+++ b/lib/string/strrchr.c
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: MIT */
+/* Derived from musl libc (Copyright © 2005-2020 Rich Felker, et al.) */
+
+#include <string.h>
+
+char *strrchr(const char *s, int c)
+{
+ return __memrchr(s, c, strlen(s) + 1);
+}