summaryrefslogtreecommitdiff
path: root/xs.h
diff options
context:
space:
mode:
Diffstat (limited to 'xs.h')
-rw-r--r--xs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/xs.h b/xs.h
index 3758c8d..b1e2cec 100644
--- a/xs.h
+++ b/xs.h
@@ -914,7 +914,8 @@ void *xs_memmem(const char *haystack, int h_size, const char *needle, int n_size
914 char *p, *r = NULL; 914 char *p, *r = NULL;
915 int offset = 0; 915 int offset = 0;
916 916
917 while (!r && h_size - offset > n_size && (p = strchr(haystack + offset, *needle))) { 917 while (!r && h_size - offset > n_size &&
918 (p = memchr(haystack + offset, *needle, h_size - offset))) {
918 if (memcmp(p, needle, n_size) == 0) 919 if (memcmp(p, needle, n_size) == 0)
919 r = p; 920 r = p;
920 else 921 else