mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
get UPNP working again. huge thanks to BigBossman and persept for doggedly tracking down this bug.
This commit is contained in:
parent
e0c0fd2a88
commit
a814d843ad
1 changed files with 33 additions and 0 deletions
|
@ -168,6 +168,7 @@ int tr_rand( int sup )
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void*
|
||||
tr_memmem( const void* haystack, size_t hl,
|
||||
const void* needle, size_t nl)
|
||||
|
@ -186,6 +187,38 @@ tr_memmem( const void* haystack, size_t hl,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
void * tr_memmem ( const void *vbig, size_t big_len,
|
||||
const void *vlittle, size_t little_len )
|
||||
{
|
||||
const char *big = vbig;
|
||||
const char *little = vlittle;
|
||||
size_t ii, jj;
|
||||
|
||||
if( 0 == big_len || 0 == little_len )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for( ii = 0; ii + little_len <= big_len; ii++ )
|
||||
{
|
||||
for( jj = 0; jj < little_len; jj++ )
|
||||
{
|
||||
if( big[ii + jj] != little[jj] )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( jj == little_len )
|
||||
{
|
||||
return (char*)big + ii;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int tr_mkdir( char * path )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue