mirror of
https://github.com/UzixLS/KernelEx.git
synced 2025-07-19 07:21:20 +03:00
import KernelEx-4.0-RC1
This commit is contained in:
19
kexcrt/memrchr.c
Normal file
19
kexcrt/memrchr.c
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* memrchr.c
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
void *memrchr(const void *s, int c, size_t n)
|
||||
{
|
||||
const unsigned char *sp = (const unsigned char *)s + n - 1;
|
||||
|
||||
while (n--) {
|
||||
if (*sp == (unsigned char)c)
|
||||
return (void *)sp;
|
||||
sp--;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
Reference in New Issue
Block a user