summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfssum/shortsum.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/btrfs/btrfssum/shortsum.go')
-rw-r--r--lib/btrfs/btrfssum/shortsum.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/btrfs/btrfssum/shortsum.go b/lib/btrfs/btrfssum/shortsum.go
index 6fd0c68..aaf7a89 100644
--- a/lib/btrfs/btrfssum/shortsum.go
+++ b/lib/btrfs/btrfssum/shortsum.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -56,10 +56,11 @@ func (sum ShortSum) EncodeJSON(w io.Writer) error {
}
func deHex(r rune) (byte, bool) {
- if r > 0xff {
+ if r > math.MaxUint8 {
return 0, false
}
c := byte(r)
+ //nolint:gomnd // Hex conversion.
switch {
case '0' <= c && c <= '9':
return c - '0', true