From d624023ca376b27a467b1cd54c3992a7e1d862ab Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 12 Jan 2019 00:44:32 +0200 Subject: Fix potential negative index when getting color from name --- ui/widget/color.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/widget') diff --git a/ui/widget/color.go b/ui/widget/color.go index e2c2b68..37a931a 100644 --- a/ui/widget/color.go +++ b/ui/widget/color.go @@ -60,8 +60,8 @@ func GetHashColorName(s string) string { return "yellow" default: h := fnv.New32a() - h.Write([]byte(s)) - return colorNames[int(h.Sum32())%len(colorNames)] + _, _ = h.Write([]byte(s)) + return colorNames[h.Sum32()%uint32(len(colorNames))] } } -- cgit v1.2.3