From 717bcbd7ff27b2fe8bfe2a8f5e00a4f096f03330 Mon Sep 17 00:00:00 2001 From: crash Date: Wed, 5 Nov 2025 15:03:58 -0800 Subject: [PATCH 1/2] max in 0x notation --- lib/src/utils/var_int.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/utils/var_int.dart b/lib/src/utils/var_int.dart index 45fcdae..9cf55f1 100644 --- a/lib/src/utils/var_int.dart +++ b/lib/src/utils/var_int.dart @@ -53,13 +53,13 @@ extension VarIntExtension on ByteData { this.setUint8(index, _target32); this.setUint32(index + 1, value); lengthInBytes = 5; - } else if (value <= 0x7FFFFFFFFFFFFFFF) { + } else if (value <= 0x8000000000000000) { this.setUint8(index, _target64); this.setUint64(index + 1, value); lengthInBytes = 9; } else { throw new ArgumentError.value( - value, 'value', 'must not exceed 0x7FFFFFFFFFFFFFFF!'); + value, 'value', 'must not exceed 0x8000000000000000!'); } return lengthInBytes; } From 6debac6ea2cbbd997d7511075fc9883eec4e3db2 Mon Sep 17 00:00:00 2001 From: crash Date: Wed, 5 Nov 2025 15:04:11 -0800 Subject: [PATCH 2/2] no = --- lib/src/utils/var_int.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/utils/var_int.dart b/lib/src/utils/var_int.dart index 9cf55f1..b6b6086 100644 --- a/lib/src/utils/var_int.dart +++ b/lib/src/utils/var_int.dart @@ -53,7 +53,7 @@ extension VarIntExtension on ByteData { this.setUint8(index, _target32); this.setUint32(index + 1, value); lengthInBytes = 5; - } else if (value <= 0x8000000000000000) { + } else if (value < 0x8000000000000000) { this.setUint8(index, _target64); this.setUint64(index + 1, value); lengthInBytes = 9;