Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
memrchr.c File Reference
#include <string.h>
Include dependency graph for memrchr.c:

Go to the source code of this file.

Functions

void * __memrchr (const void *, int, size_t)
 

Function Documentation

◆ __memrchr()

void * __memrchr ( const void *  m,
int  c,
size_t  n 
)

Definition at line 7 of file memrchr.c.

8 {
9  const unsigned char* s = m;
10  c = (unsigned char)c;
11 
12  while(n--)
13  {
14  if(s[n] == c)
15  {
16  return (void*)(uintptr_t)(s + n);
17  }
18  }
19 
20  return 0;
21 }

Referenced by strrchr().

Here is the caller graph for this function: