Skip to content

Commit

Permalink
Update codes for lints/security
Browse files Browse the repository at this point in the history
  • Loading branch information
johnteee committed Jun 2, 2022
1 parent 5ebf73c commit 4888846
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions maybe.go
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ func (maybeSelf someDef[T]) ToUintptr() (uintptr, error) {
return uintptr(0), ErrConversionUnsupported
case string:
parseInt, err := strconv.ParseInt((ref).(string), 10, 64)
if uint64(parseInt) < maxUintptr {
if uint64(parseInt) <= maxUintptr {
return uintptr(parseInt), err
}
return uintptr(0), ErrConversionSizeOverflow
Expand All @@ -1142,7 +1142,7 @@ func (maybeSelf someDef[T]) ToUintptr() (uintptr, error) {
return uintptr(val), err
case uint64:
val, err := maybeSelf.ToUint64()
if val < maxUintptr {
if val <= maxUintptr {
return uintptr(val), err
}
return uintptr(0), ErrConversionSizeOverflow
Expand All @@ -1165,7 +1165,7 @@ func (maybeSelf someDef[T]) ToUintptr() (uintptr, error) {
return uintptr(val), err
case int64:
val, err := maybeSelf.ToInt64()
if uint64(val) < maxUintptr {
if uint64(val) <= maxUintptr {
return uintptr(val), err
}
return uintptr(0), ErrConversionSizeOverflow
Expand Down

0 comments on commit 4888846

Please sign in to comment.