1
0
Fork 0
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:
Patrick Seeburger 2018-10-01 10:25:26 +02:00 committed by Benedikt Rudolph
parent 7fd2dfd0cf
commit 95cf1a71af

View file

@ -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