From 328e6a2eac045dc49aefffc305da109d129d222f Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Fri, 8 Dec 2023 16:28:36 -0500 Subject: [PATCH] well thats embarrassing -- these checks weren't really matching what the C equivalent assert() was doing; --- EDAC/CRC.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/EDAC/CRC.cs b/EDAC/CRC.cs index c5e85b5..f5235ac 100644 --- a/EDAC/CRC.cs +++ b/EDAC/CRC.cs @@ -299,7 +299,7 @@ namespace fnecore.EDAC { if (_in == null) throw new NullReferenceException("_in"); - if (length > 2) + if (length <= 2) throw new ArgumentOutOfRangeException("length"); UShortUnion union = new UShortUnion(); @@ -323,7 +323,7 @@ namespace fnecore.EDAC { if (_in == null) throw new NullReferenceException("_in"); - if (length > 2) + if (length <= 2) throw new ArgumentOutOfRangeException("length"); UShortUnion union = new UShortUnion(); @@ -349,7 +349,7 @@ namespace fnecore.EDAC { if (_in == null) throw new NullReferenceException("_in"); - if (length > 2) + if (length <= 2) throw new ArgumentOutOfRangeException("length"); UShortUnion union = new UShortUnion(); @@ -373,7 +373,7 @@ namespace fnecore.EDAC { if (_in == null) throw new NullReferenceException("_in"); - if (length > 2) + if (length <= 2) throw new ArgumentOutOfRangeException("length"); UShortUnion union = new UShortUnion(); @@ -398,7 +398,7 @@ namespace fnecore.EDAC { if (_in == null) throw new NullReferenceException("_in"); - if (length > 4) + if (length <= 4) throw new ArgumentOutOfRangeException("length"); UIntUnion union = new UIntUnion(); @@ -425,7 +425,7 @@ namespace fnecore.EDAC { if (_in == null) throw new NullReferenceException("_in"); - if (length > 4) + if (length <= 4) throw new ArgumentOutOfRangeException("length"); UIntUnion union = new UIntUnion();