1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

get UPNP working again. huge thanks to BigBossman and persept for doggedly tracking down this bug.

This commit is contained in:
Charles Kerr 2007-07-15 22:18:49 +00:00
parent e0c0fd2a88
commit a814d843ad

View file

@ -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 )
{