From aaf63b39257c1added9f38bb31664ff044540a01 Mon Sep 17 00:00:00 2001
From: coshcage <58808125+coshcage@users.noreply.github.com>
Date: Wed, 1 Nov 2023 12:36:16 +0000
Subject: [PATCH] Add files via upload

---
 src/sitable.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/sitable.c b/src/sitable.c
index 8e2f025..583b7f5 100644
--- a/src/sitable.c
+++ b/src/sitable.c
@@ -2,7 +2,7 @@
  * Name:        sitable.c
  * Description: SI functions for tables.
  * Author:      cosh.cage#hotmail.com
- * File ID:     0628231947C1101231110L00976
+ * File ID:     0628231947C1101231110L00978
  * License:     GPLv2.
  */
 #define _CRT_SECURE_NO_WARNINGS
@@ -83,6 +83,8 @@ static int _sicbfcmpSV(const void * px, const void * py)
  */
 void siSortView(P_MATRIX pmtx, size_t col, BOOL ascd)
 {
+	if (col >= pmtx->col)
+		return;
 	sizSVTarget = col;
 	bAscend = ascd;
 	qsort(pmtx->arrz.pdata, pmtx->ln, sizeof(P_CELL) * pmtx->col, _sicbfcmpSV);