From ff836d0d287ef1378fb36f68037e7725a661cf7a Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 24 May 2026 10:12:28 +0300 Subject: fix(rpn): use < instead of <= for _sentinel in parseCategory parseCategory iterated over _sentinel itself, causing it to return true for the sentinel value (an invalid category). Use strict less- than so only valid categories match. --- internal/rpn/operations_metric_cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/rpn/operations_metric_cmd.go b/internal/rpn/operations_metric_cmd.go index 61e3f82..8e0e519 100644 --- a/internal/rpn/operations_metric_cmd.go +++ b/internal/rpn/operations_metric_cmd.go @@ -85,7 +85,7 @@ func (o *Operations) MetricCompatible(stack *Stack) (string, error) { // so adding a new Category constant (between Universal and _sentinel) automatically // makes it available here without modifying this function. func parseCategory(name string) (Category, bool) { - for cat := Category(0); cat <= _sentinel; cat++ { + for cat := Category(0); cat < _sentinel; cat++ { if cat.String() == name { return cat, true } -- cgit v1.2.3