Ignore:
Timestamp:
May 22, 2009, 5:35:51 AM (13 years ago)
Author:
charles
Message:

(trunk) dht seems to be crashing in bcmp() on the mac, so I suspect the homegrown implementation of memmem() is buggy... test this out by replacing memmem()'s implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r8450 r8478  
    696696#else
    697697    size_t i;
    698     for( i=0; i<haystacklen-needlelen; ++i )
     698    if( !needlelen )
     699        return haystack;
     700    if( needlelen > haystacklen || !haystack || !needle )
     701        return NULL;
     702    for( i=0; i<=haystacklen-needlelen; ++i )
    699703        if( !memcmp( haystack+i, needle, needlelen ) )
    700704            return haystack+i;
Note: See TracChangeset for help on using the changeset viewer.