Browse Source

Fix: broken loop counter causing invalid notice output

Rod Hynes 11 năm trước cách đây
mục cha
commit
6dc33f0283
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      psiphon/notice.go

+ 1 - 1
psiphon/notice.go

@@ -64,7 +64,7 @@ func outputNotice(noticeType string, showUser bool, args ...interface{}) {
 	obj["showUser"] = showUser
 	obj["showUser"] = showUser
 	obj["data"] = noticeData
 	obj["data"] = noticeData
 	obj["timestamp"] = time.Now().UTC().Format(time.RFC3339)
 	obj["timestamp"] = time.Now().UTC().Format(time.RFC3339)
-	for i := 0; i < len(args)/2; i++ {
+	for i := 0; i < len(args)-1; i += 2 {
 		name, ok := args[i].(string)
 		name, ok := args[i].(string)
 		value := args[i+1]
 		value := args[i+1]
 		if ok {
 		if ok {