Changeset 2365


Ignore:
Timestamp:
Jul 15, 2007, 10:18:49 PM (15 years ago)
Author:
charles
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r2360 r2365  
    169169
    170170
     171#if 0
    171172void*
    172173tr_memmem( const void* haystack, size_t hl,
     
    187188    return NULL;
    188189}
     190#else
     191void * tr_memmem ( const void *vbig, size_t big_len,
     192                   const void *vlittle, size_t little_len )
     193{
     194    const char *big = vbig;
     195    const char *little = vlittle;
     196    size_t ii, jj;
     197
     198    if( 0 == big_len || 0 == little_len )
     199    {
     200        return NULL;
     201    }
     202
     203    for( ii = 0; ii + little_len <= big_len; ii++ )
     204    {
     205        for( jj = 0; jj < little_len; jj++ )
     206        {
     207            if( big[ii + jj] != little[jj] )
     208            {
     209                break;
     210            }
     211        }
     212        if( jj == little_len )
     213        {
     214            return (char*)big + ii;
     215        }
     216    }
     217
     218    return NULL;
     219}
     220#endif
     221
    189222
    190223int tr_mkdir( char * path )
Note: See TracChangeset for help on using the changeset viewer.