From 0f6308ace5ff0ed3a94175cc827e48b69d6fe2b3 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Tue, 19 Nov 2024 09:41:22 -0700 Subject: [PATCH] Bug in array --- Adaptation/FileHandlers/pcl/Header.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Adaptation/FileHandlers/pcl/Header.cs b/Adaptation/FileHandlers/pcl/Header.cs index a94b1a9..cf92d3a 100644 --- a/Adaptation/FileHandlers/pcl/Header.cs +++ b/Adaptation/FileHandlers/pcl/Header.cs @@ -138,11 +138,13 @@ public class Header { List results = new(); const int MAX_COLUMNS = 9; - int[] mColumnWidths = new int[MAX_COLUMNS] { 8, 6, 6, 6, 6, 7, 7, 5, 7 }; - if (toEol.Length < MAX_COLUMNS) + if (toEol.Length >= MAX_COLUMNS) + results.AddRange(toEol); + else { string leftVal, rightVal; List toEolList = new(toEol); + int[] mColumnWidths = new int[MAX_COLUMNS] { 8, 6, 6, 6, 6, 7, 7, 5, 7 }; if (string.IsNullOrEmpty(toEolList[toEolList.Count - 1])) toEolList.RemoveAt(toEolList.Count - 1); for (int i = toEolList.Count; i < MAX_COLUMNS; i++)