git: 9front

Download patch

ref: 68817e5f89e252f49d280071be66782ea6c0e73e
parent: 61c6956d65606e437ba7892f469cadf28277ed4d
author: cinap_lenrek <cinap_lenrek@felloff.net>
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;
 }
 
--