ref: ff677a1cb491b8a3b028057b71f662472107b418
parent: 8fb212515dc6e0a8f0cc3b76f7946bb26b8c357d
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Mar 13 23:54:08 EDT 2014
cpu: make -p work with explicit service in dialstring (same as import)
--- a/sys/src/cmd/cpu.c
+++ b/sys/src/cmd/cpu.c
@@ -783,7 +783,8 @@
buf[len] = '\0';
if((s = strrchr(buf, '!')) == nil)
fatal("filter: malformed remote port: %s", buf);
- snprint(addr, sizeof(addr), "%s", netmkaddr(host, "tcp", s+1));
+ strecpy(addr, addr+sizeof(addr), netmkaddr(host, "tcp", s+1));
+ strecpy(strrchr(addr, '!'), addr+sizeof(addr), s);
}
snprint(buf, sizeof(buf), "%s", filterp);