net: fix ParseIP

Fixes #1695.

R=golang-dev, rsc
CC=golang-dev, r
https://golang.org/cl/4418042
This commit is contained in:
Quan Yong Zhai 2011-04-14 23:49:51 -04:00 committed by Russ Cox
parent 24bb0340b6
commit c09af6631f
2 changed files with 2 additions and 1 deletions

View file

@ -436,7 +436,7 @@ func parseIPv6(s string) IP {
}
// Otherwise must be followed by colon and more.
if s[i] != ':' && i+1 == len(s) {
if s[i] != ':' || i+1 == len(s) {
return nil
}
i++