Gofix for r59.

This commit is contained in:
Alex Bramley 2011-08-03 08:04:01 +01:00
parent cd53356ca6
commit b32e8d050f
2 changed files with 3 additions and 3 deletions

View File

@ -218,7 +218,7 @@ func (conn *Conn) h_352(line *Line) {
// XXX: do we care about the actual server the nick is on?
// or the hop count to this server?
// last arg contains "<hop count> <real name>"
a := strings.Split(line.Args[len(line.Args)-1], " ", 2)
a := strings.SplitN(line.Args[len(line.Args)-1], " ", 2)
n.Name = a[1]
if idx := strings.Index(line.Args[6], "*"); idx != -1 {
n.Modes.Oper = true
@ -234,7 +234,7 @@ func (conn *Conn) h_352(line *Line) {
// Handle 353 names reply
func (conn *Conn) h_353(line *Line) {
if ch := conn.GetChannel(line.Args[2]); ch != nil {
nicks := strings.Split(line.Args[len(line.Args)-1], " ", -1)
nicks := strings.Split(line.Args[len(line.Args)-1], " ")
for _, nick := range nicks {
// UnrealIRCd's coders are lazy and leave a trailing space
if nick == "" {

View File

@ -49,7 +49,7 @@ func parseLine(s string) *Line {
// now we're here, we've parsed a :nick!user@host or :server off
// s should contain "cmd args[] :text"
args := strings.Split(s, " :", 2)
args := strings.SplitN(s, " :", 2)
if len(args) > 1 {
args = append(strings.Fields(args[0]), args[1])
} else {