From 272ef5a6ba0c8d92d68b3688440066e23aba88c5 Mon Sep 17 00:00:00 2001 From: BlackEagle Date: Thu, 11 Dec 2014 14:24:17 +0100 Subject: [PATCH] atlas post-processor on 32bit uint32 overflows int post-processor/atlas/util.go:16: constant 4294967295 overflows int Signed-off-by: BlackEagle --- post-processor/atlas/util.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/post-processor/atlas/util.go b/post-processor/atlas/util.go index 7941db563..1c0bfa27f 100644 --- a/post-processor/atlas/util.go +++ b/post-processor/atlas/util.go @@ -11,13 +11,14 @@ import ( // // This function just uses brute force instead of a more optimized algorithm. func longestCommonPrefix(vs []string) string { + var length int64 // Find the shortest string var shortest string - length := math.MaxUint32 + length = math.MaxUint32 for _, v := range vs { - if len(v) < length { + if int64(len(v)) < length { shortest = v - length = len(v) + length = int64(len(v)) } }