# | Line 42 | Line 42 | memmem(const void *l, size_t l_len, const void *s, siz | |
---|---|---|
42 | const char *cl = (const char *)l; | |
43 | const char *cs = (const char *)s; | |
44 | ||
45 | < | /* we need something to compare */ |
46 | < | if (l_len == 0 || s_len == 0) |
47 | < | return NULL; |
45 | > | /* empty "s" matches the beginning of "l" */ |
46 | > | if (s_len == 0) |
47 | > | return (void *)cl; |
48 | ||
49 | /* "s" must be smaller or equal to "l" */ | |
50 | if (l_len < s_len) |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |