1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

boring tr_memmem tweaks

This commit is contained in:
Charles Kerr 2009-05-20 04:30:55 +00:00
parent af213891f9
commit d0a84bcf09

View file

@ -694,14 +694,10 @@ tr_memmem( const char * haystack, size_t haystacklen,
#ifdef HAVE_MEMMEM
return memmem( haystack, haystacklen, needle, needlelen );
#else
const char *h = haystack;
const char *n = needle;
size_t i;
for( i=0; i<haystacklen-needlelen; ++i )
if( !memcmp( h+i, n, needlelen ) )
return h+i;
if( !memcmp( haystack+i, needle, needlelen ) )
return haystack+i;
return NULL;
#endif
}