ip/torrent: fix silly readn() error check (thanks pr)

This commit is contained in:
cinap_lenrek 2022-04-18 21:03:40 +00:00
parent 061ec57021
commit 9993b3909e

View file

@ -404,7 +404,7 @@ peer(int fd, int incoming, char *addr)
}
if((incoming && !i) || (!incoming && i)){
n = 20 + 8 + sizeof(infohash);
if((n = readn(fd, buf, n)) != n)
if(readn(fd, buf, n) != n)
return 1;
if(memcmp(buf, "\x13BitTorrent protocol", 20))
return 0;