Ignore:
Timestamp:
May 19, 2009, 4:48:33 AM (13 years ago)
Author:
charles
Message:

(trunk libT) expose tr_memmem() so it can be used by client code. use the OS' implementation if that's available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc-server.c

    r8414 r8424  
    133133
    134134    tr_releaseBuffer( body );
    135 }
    136 
    137 static const char*
    138 tr_memmem( const char * s1, size_t l1, /* haystack */
    139            const char * s2, size_t l2 ) /* needle */
    140 {
    141     if( !l2 ) return s1;
    142     while( l1 >= l2 )
    143     {
    144         l1--;
    145         if( !memcmp( s1, s2, l2 ) )
    146             return s1;
    147         s1++;
    148     }
    149 
    150     return NULL;
    151135}
    152136
Note: See TracChangeset for help on using the changeset viewer.