diff options
| author | Pali Rohár <pali.rohar@gmail.com> | 2015-01-15 09:42:01 +0100 |
|---|---|---|
| committer | Pali Rohár <pali.rohar@gmail.com> | 2015-01-15 09:42:01 +0100 |
| commit | f965980e2b309921e0b869c05177f1ee3937a845 (patch) | |
| tree | d0e23e859eec9f3f901b860f42fbd4ce29969f65 /src | |
| parent | ef678ecf6c72c3df72b28685f83186228c5afd9b (diff) | |
| download | 0xFFFF-f965980e2b309921e0b869c05177f1ee3937a845.tar.bz2 | |
all: Fix MEMMEM implementation
Diffstat (limited to 'src')
| -rw-r--r-- | src/global.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/global.h b/src/global.h index 4cff79f..a26c88b 100644 --- a/src/global.h +++ b/src/global.h @@ -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; |