From 6f3ed4a10e6188ee6ccc746d9acd38b2223ff9a8 Mon Sep 17 00:00:00 2001 From: Francesco Cattoni Date: Tue, 12 Apr 2022 17:38:45 +0200 Subject: [PATCH] Fixed DbfValueDateTime null values checking --- src/DbfDataReader/DbfValueDateTime.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/DbfDataReader/DbfValueDateTime.cs b/src/DbfDataReader/DbfValueDateTime.cs index 9b128a1..e3fa837 100644 --- a/src/DbfDataReader/DbfValueDateTime.cs +++ b/src/DbfDataReader/DbfValueDateTime.cs @@ -11,7 +11,15 @@ public DbfValueDateTime(int start, int length) : base(start, length) public override void Read(ReadOnlySpan bytes) { - if (bytes[0] == '\0') + int i; + for (i = 0; i < bytes.Length; i++) + { + if (bytes[0] != '\0') + { + break; + } + } + if (i == bytes.Length) { Value = null; }