From 48e22ab769860264a44c8b6d12fe0575bcaaf035 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 13 May 2026 12:05:47 +0000 Subject: [PATCH] policy/v2: rewrite tag-name first-letter check via De Morgan --- hscontrol/policy/v2/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hscontrol/policy/v2/types.go b/hscontrol/policy/v2/types.go index 85863316..be18189c 100644 --- a/hscontrol/policy/v2/types.go +++ b/hscontrol/policy/v2/types.go @@ -542,7 +542,7 @@ func (t *Tag) Validate() error { } first := rest[0] - if !((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z')) { + if (first < 'a' || first > 'z') && (first < 'A' || first > 'Z') { return ErrTagNameMustStartWithLetter }