(trunk libT) #3204 "crash in tr_torrentGetMagnetLink() when the torrent doesn't have a display name yet" -- fixed in trunk for 2.00
This commit is contained in:
parent
3ff784ad28
commit
6d9ac874d8
|
@ -306,14 +306,19 @@ tr_torrentGetMagnetLink( const tr_torrent * tor )
|
|||
{
|
||||
int i;
|
||||
char * ret;
|
||||
const char * name;
|
||||
struct evbuffer * s;
|
||||
|
||||
assert( tr_isTorrent( tor ) );
|
||||
|
||||
s = evbuffer_new( );
|
||||
evbuffer_add_printf( s, "magnet:?xt=urn:btih:%s", tor->info.hashString );
|
||||
evbuffer_add_printf( s, "%s", "&dn=" );
|
||||
tr_http_escape( s, tr_torrentName( tor ), -1, TRUE );
|
||||
name = tr_torrentName( tor );
|
||||
if( name && *name )
|
||||
{
|
||||
evbuffer_add_printf( s, "%s", "&dn=" );
|
||||
tr_http_escape( s, tr_torrentName( tor ), -1, TRUE );
|
||||
}
|
||||
for( i=0; i<tor->info.trackerCount; ++i )
|
||||
{
|
||||
evbuffer_add_printf( s, "%s", "&tr=" );
|
||||
|
|
Loading…
Reference in New Issue