aboutsummaryrefslogtreecommitdiffstats
path: root/memory/rawmemchr.c
blob: 496fe8a6283e5283b43cf63246351bbe3ceac4d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
#include "memory.h"

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