aboutsummaryrefslogtreecommitdiffstats
path: root/memory/memlchr.c
blob: 34aa7d0c5a58b6e57955d4f29daf9ff9dae02910 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#include "memory.h"

size_t memlchr(void const *buf, int value, size_t size)
{
	unsigned char const *buffer = buf;
	for (size_t i = 0; i < size; i++)
		if (buffer[i] == (unsigned char)value)
			return i;
	return size;
}