From e007ce2ffabc88b25adb3cc7139649e040b2a55e 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 91119835..8051ccd4 100644 --- a/hscontrol/policy/v2/types.go +++ b/hscontrol/policy/v2/types.go @@ -562,7 +562,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 }