From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/string/memrchr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/string/memrchr.c (limited to 'src/string/memrchr.c') diff --git a/src/string/memrchr.c b/src/string/memrchr.c new file mode 100644 index 0000000..e51748b --- /dev/null +++ b/src/string/memrchr.c @@ -0,0 +1,11 @@ +#include + +void *__memrchr(const void *m, int c, size_t n) +{ + const unsigned char *s = m; + c = (unsigned char)c; + while (n--) if (s[n]==c) return (void *)(s+n); + return 0; +} + +weak_alias(__memrchr, memrchr); -- cgit v1.2.3