Bug in array

This commit is contained in:
Mike Phares 2024-11-19 09:41:22 -07:00
parent 3a23304824
commit 0f6308ace5

View File

@ -138,11 +138,13 @@ public class Header
{
List<string> 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<string> 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++)