dte test coverage


Directory: ./
File: src/util/xmemrchr.c
Date: 2025-11-12 12:04:10
Coverage Exec Excl Total
Lines: 100.0% 2 0 2
Functions: 100.0% 1 0 1
Branches: -% 0 0 0

Line Branch Exec Source
1 #include "build-defs.h"
2 #include <string.h>
3 #include "xmemrchr.h"
4
5 347 void *xmemrchr(const void *ptr, int c, size_t n)
6 {
7 #if HAVE_MEMRCHR
8 347 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