public: fix Q_memmem counting haystack size incorrectly
This commit is contained in:
parent
409edf5a70
commit
75ccd2283b
1 changed files with 4 additions and 1 deletions
|
@ -382,8 +382,11 @@ const byte *Q_memmem( const byte *haystack, size_t haystacklen, const byte *need
|
|||
if( !memcmp( i, needle, needlelen ))
|
||||
return i;
|
||||
|
||||
// skip one byte
|
||||
i++;
|
||||
|
||||
haystacklen -= i - haystack;
|
||||
haystack = i + 1;
|
||||
haystack = i;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue