From 01cda206659d118c099f373aad1a9d95e6ce3123 Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Sun, 19 Jan 2025 15:41:54 -0500 Subject: [PATCH] tape: Fix U16CastSafe --- tape/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tape/types.go b/tape/types.go index db2c852..32a2e59 100644 --- a/tape/types.go +++ b/tape/types.go @@ -303,7 +303,7 @@ func I64ArraySize[T Int64](value []T) (int, error) { // U16CastSafe safely casts an integer to a uint16. If an overflow or underflow // occurs, it will return (0, false). func U16CastSafe(n int) (uint16, bool) { - if n < uint16Max && n > 0 { + if n < uint16Max && n >= 0 { return uint16(n), true } else { return 0, false