Files
openharmony_kernel_liteos_m/kal/posix/musl_src/string/memrchr.c
T
wuyunjie 955b52e4b2 Description:l0 posix interface
Team: OTHERS
Feature or Bugfix:Feature
Binary Source:No
PrivateCode(Yes/No):No

Change-Id: I8bcb92a97a98c61077c55704dec03c997d1246da
ChangeID:13439291
2021-03-27 10:38:56 +08:00

11 lines
185 B
C

#include <string.h>
void *__memrchr(const void *m, int c, size_t n)
{
const unsigned char *s = m;
c = (unsigned char)c;
while (n--) if (s[n]==c) return (void *)(s+n);
return 0;
}