diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-03 15:22:22 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-09 16:26:14 -0400 |
commit | 477670f48167cac1b871b061713cc1b594a2a941 (patch) | |
tree | 699c9d61214fc762a5a971f73feb59798909d620 /linux/string.c | |
parent | 5531accc97da082b7a102240e34fdf15c68a8991 (diff) |
Update bcachefs sources to 07f9a27f1969 bcachefs: add no_invalid_checks flag
Diffstat (limited to 'linux/string.c')
-rw-r--r-- | linux/string.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/linux/string.c b/linux/string.c index a32a8995..f91b5380 100644 --- a/linux/string.c +++ b/linux/string.c @@ -110,3 +110,16 @@ int match_string(const char * const *array, size_t n, const char *string) return -EINVAL; } + +void *memscan(void *addr, int c, size_t size) +{ + unsigned char *p = addr; + + while (size) { + if (*p == (unsigned char)c) + return (void *)p; + p++; + size--; + } + return (void *)p; +} |