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