all: Fix MEMMEM implementation
This commit is contained in:
1 parent
ef678ecf6c
commit
f965980e2b
1 file changed
+1
-1
+1
-1
@@ -27,7 +27,7 @@ extern int verbose;
|
||||
static inline void * MEMMEM(void *haystack, size_t haystacklen, const void *needle, size_t needlelen) {
|
||||
for ( size_t i = 0; i < haystacklen; ++i ) {
|
||||
for ( size_t j = 0; j < needlelen; ++j ) {
|
||||
if ( ((char *)haystack)[i] != ((const char *)needle)[j] )
|
||||
if ( ((char *)haystack)[i+j] != ((const char *)needle)[j] )
|
||||
break;
|
||||
if ( j != needlelen - 1 )
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user