diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index 1348e9ae6..82846e0f9 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -242,7 +242,7 @@ const char* tr_peerIoAddrStr( const struct in_addr * addr, uint16_t port ) { static char buf[512]; - snprintf( buf, sizeof(buf), "%s:%u", inet_ntoa( *addr ), (unsigned int)port ); + snprintf( buf, sizeof(buf), "%s:%u", inet_ntoa( *addr ), ntohs( port ) ); return buf; } diff --git a/libtransmission/tracker.c b/libtransmission/tracker.c index 16bb9304c..1bec7b92f 100644 --- a/libtransmission/tracker.c +++ b/libtransmission/tracker.c @@ -254,7 +254,8 @@ publishNewPeers( tr_tracker * t, int count, uint8_t * peers ) event.peerCount = count; event.peerCompact = peers; tr_inf( "Torrent \"%s\" got %d new peers", t->name, count ); - tr_publisherPublish( t->publisher, t, &event ); + if( count ) + tr_publisherPublish( t->publisher, t, &event ); } /***