tools: Fix shadow variables and incorrect printing format.

This commit is contained in:
ngaut 2015-11-30 20:13:29 +08:00
parent d705df047b
commit 232439191c

View File

@ -166,9 +166,9 @@ func main() {
ports := []uint16{}
for _, p := range strings.Split(*portsArg, ",") {
p, err := strconv.Atoi(p)
port, err := strconv.Atoi(p)
if err == nil {
ports = append(ports, uint16(p))
ports = append(ports, uint16(port))
} else {
fmt.Fprintf(os.Stderr, "Failed to parse port \"%s\": %v\n", p, err)
os.Exit(1)