Skip to content

Commit 9c8bfb7

Browse files
author
Tensei
committed
now?
1 parent 13e56b1 commit 9c8bfb7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tool/tool.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,18 @@ func createTopList() error {
374374
continue
375375
}
376376

377-
endofdate := bytes.Index(line, []byte("UTC] ")) + 5
378-
if len(line) <= endofdate {
377+
endofdate := bytes.Index(line, []byte("UTC] "))
378+
if len(line) <= endofdate || endofdate < 6 {
379379
continue
380380
}
381+
endofdate += 5
381382
endofnick := bytes.Index(line[endofdate:], []byte(":"))
383+
if endofnick == -1 {
384+
continue
385+
}
382386

383387
nick := line[endofdate : endofnick+endofdate]
384-
if err != nil {
385-
fmt.Println(err)
386-
}
388+
387389

388390
if _, ok := toplist[string(nick)]; !ok {
389391
toplist[string(nick)] = &user{

0 commit comments

Comments
 (0)