mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
public: fix Q_memmem counting haystack size incorrectly
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user