aboutsummaryrefslogtreecommitdiffstats
path: root/memory/wmemrchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'memory/wmemrchr.c')
-rw-r--r--memory/wmemrchr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/memory/wmemrchr.c b/memory/wmemrchr.c
new file mode 100644
index 0000000..c7b1684
--- /dev/null
+++ b/memory/wmemrchr.c
@@ -0,0 +1,9 @@
+#include "memory.h"
+
+wchar_t *wmemrchr(wchar_t const *buffer, wchar_t value, size_t size)
+{
+ for (size_t i = size; i-- > 0;)
+ if (buffer[i] == value)
+ return (wchar_t *)&buffer[i];
+ return NULL;
+}