tape: Fix U16CastSafe
This commit is contained in:
parent
aac5266c0c
commit
01cda20665
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user