mirror of
https://github.com/alice-lg/birdwatcher.git
synced 2025-03-09 00:00:05 +01:00
Fixed a bug in the parser that would return an integer of the wrong type
(int vs. int64) in an error case.
This commit is contained in:
parent
7fd2dfd0cf
commit
95cf1a71af
1 changed files with 5 additions and 5 deletions
|
@ -514,10 +514,10 @@ func parseProtocol(lines string) Parsed {
|
|||
|
||||
if _, ok := res["routes"]; !ok {
|
||||
routes := Parsed{}
|
||||
routes["accepted"] = 0
|
||||
routes["filtered"] = 0
|
||||
routes["exported"] = 0
|
||||
routes["preferred"] = 0
|
||||
routes["accepted"] = int64(0)
|
||||
routes["filtered"] = int64(0)
|
||||
routes["exported"] = int64(0)
|
||||
routes["preferred"] = int64(0)
|
||||
|
||||
res["routes"] = routes
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ func treatKey(key string) string {
|
|||
func parseInt(from string) int64 {
|
||||
val, err := strconv.ParseInt(from, 10, 64)
|
||||
if err != nil {
|
||||
return 0
|
||||
return int64(0)
|
||||
}
|
||||
|
||||
return val
|
||||
|
|
Loading…
Add table
Reference in a new issue