aboutsummaryrefslogtreecommitdiffstats
path: root/memcasemem.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--memcasemem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/memcasemem.c b/memcasemem.c
index d883b62..625861a 100644
--- a/memcasemem.c
+++ b/memcasemem.c
@@ -10,6 +10,7 @@ libsimple_memcasemem(const void *hay_, size_t hayn, const void *sub_, size_t sub
const char *sub = sub_;
size_t *next, i, j;
+
if (!subn)
return REMOVE_CONST(hay, char *);
if (hayn < subn)
@@ -17,6 +18,7 @@ libsimple_memcasemem(const void *hay_, size_t hayn, const void *sub_, size_t sub
if (subn == 1)
return libsimple_memcasechr(hay, *sub, hayn);
+ /* TODO segment search if pattern is too large */
next = alloca((subn + 1U) * sizeof(*next));
i = 0, j = SIZE_MAX;
goto beginning;