Skip to content

Commit

Permalink
Fix warning messages on overflowing integers
Browse files Browse the repository at this point in the history
  • Loading branch information
wout authored and albertorestifo committed Apr 20, 2023
1 parent b121f6f commit 3903e7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/cbor/encoder_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tests = [
{1000, "19 03 e8"},
{1000000, "1a 00 0f 42 40"},
{1000000000000, "1b 00 00 00 e8 d4 a5 10 00"},
{18446744073709551615, "1b ff ff ff ff ff ff ff ff"},
{18446744073709551615u64, "1b ff ff ff ff ff ff ff ff"},
{-1, "20"},
{-10, "29"},
{-100, "38 63"},
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/encoder.cr
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class CBOR::Encoder
when 0x0000_0000..0xffff_ffff
write_byte(offset + 0x1a)
write_value(bytesize.to_u32)
when 0x0000_0000_0000_0000..0xffff_ffff_ffff_ffff
when 0x0000_0000_0000_0000..0xffff_ffff_ffff_ffffu64
write_byte(offset + 0x1b)
write_value(bytesize.to_u64)
else
Expand Down

0 comments on commit 3903e7c

Please sign in to comment.