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

This commit is contained in:
cinap_lenrek 2022-04-18 21:03:40 +00:00 committed by xfnw
parent 0b95092e3d
commit eb81b7602c

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;