diff options
Diffstat (limited to 'src/common/linux/linux_libc_support.cc')
-rw-r--r-- | src/common/linux/linux_libc_support.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/linux/linux_libc_support.cc b/src/common/linux/linux_libc_support.cc index 845729c9..08b0325e 100644 --- a/src/common/linux/linux_libc_support.cc +++ b/src/common/linux/linux_libc_support.cc @@ -138,6 +138,16 @@ const char* my_strrchr(const char* haystack, char needle) { return ret; } +void* my_memchr(const void* src, int needle, size_t src_len) { + const unsigned char* p = (const unsigned char*)src; + const unsigned char* p_end = p + src_len; + for (; p < p_end; ++p) { + if (*p == needle) + return (void*)p; + } + return NULL; +} + // Read a hex value // result: (output) the resulting value // s: a string |