dte test coverage


Directory: ./
File: src/util/xmemrchr.c
Date: 2024-12-21 16:03:22
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 #include "feature.h"
2 #include <string.h>
3 #include "xmemrchr.h"
4
5 44 void *xmemrchr(const void *ptr, int c, size_t n)
6 {
7 #if HAVE_MEMRCHR
8 44 return memrchr(ptr, c, n);
9 #endif
10
11 for (const unsigned char *s = ptr; n--; ) {
12 if (s[n] == (unsigned char)c) {
13 return (void*)(s + n);
14 }
15 }
16
17 return NULL;
18 }
19