From 95cf1a71afb078abaa9e08cd34c0ef108dd04a01 Mon Sep 17 00:00:00 2001 From: Patrick Seeburger Date: Mon, 1 Oct 2018 10:25:26 +0200 Subject: [PATCH] Fixed a bug in the parser that would return an integer of the wrong type (int vs. int64) in an error case. --- bird/parser.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bird/parser.go b/bird/parser.go index ad20c6e..863a824 100644 --- a/bird/parser.go +++ b/bird/parser.go @@ -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