shithub: riscv

Download patch

ref: 9993b3909e504b29083dae07822e5489917d5cb8
parent: 061ec57021a7c813844582f6f1973dafae6e668b
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Apr 18 17:03:40 EDT 2022

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

--- a/sys/src/cmd/ip/torrent.c
+++ b/sys/src/cmd/ip/torrent.c
@@ -404,7 +404,7 @@
 		}
 		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;