shithub: riscv

Download patch

ref: 1335a57865c1a966a58437779d15aa63a775d64e
parent: bcaf95bb5a60cd0fabbf5a20cd34a657e832484a
author: cinap_lenrek <[email protected]>
date: Sun Feb 24 22:48:12 EST 2019

ip/torrent: fix %.*s format in dialstring

--- a/sys/src/cmd/ip/torrent.c
+++ b/sys/src/cmd/ip/torrent.c
@@ -907,7 +907,7 @@
 		if((x = strchr(url, '/')) == nil)
 			x = strchr(url, 0);
 	}
-	snprint(addr, naddr, "udp!%.*s!%d", (int)(x-url), url, port);
+	snprint(addr, naddr, "udp!%.*s!%d", utfnlen(url, x-url), url, port);
 	return 0;
 }