mirror of
https://github.com/hashicorp/packer.git
synced 2026-10-01 12:13:59 -04:00
Merge pull request #1748 from BlackIkeEagle/constant-4294967295-overflows-int
atlas post-processor on 32bit uint32 overflows int
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user