Skip to content

Commit 4888846

Browse files
committed
Update codes for lints/security
1 parent 5ebf73c commit 4888846

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

maybe.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ func (maybeSelf someDef[T]) ToUintptr() (uintptr, error) {
11211121
return uintptr(0), ErrConversionUnsupported
11221122
case string:
11231123
parseInt, err := strconv.ParseInt((ref).(string), 10, 64)
1124-
if uint64(parseInt) < maxUintptr {
1124+
if uint64(parseInt) <= maxUintptr {
11251125
return uintptr(parseInt), err
11261126
}
11271127
return uintptr(0), ErrConversionSizeOverflow
@@ -1142,7 +1142,7 @@ func (maybeSelf someDef[T]) ToUintptr() (uintptr, error) {
11421142
return uintptr(val), err
11431143
case uint64:
11441144
val, err := maybeSelf.ToUint64()
1145-
if val < maxUintptr {
1145+
if val <= maxUintptr {
11461146
return uintptr(val), err
11471147
}
11481148
return uintptr(0), ErrConversionSizeOverflow
@@ -1165,7 +1165,7 @@ func (maybeSelf someDef[T]) ToUintptr() (uintptr, error) {
11651165
return uintptr(val), err
11661166
case int64:
11671167
val, err := maybeSelf.ToInt64()
1168-
if uint64(val) < maxUintptr {
1168+
if uint64(val) <= maxUintptr {
11691169
return uintptr(val), err
11701170
}
11711171
return uintptr(0), ErrConversionSizeOverflow

0 commit comments

Comments
 (0)