From 051fc225d450451cc4ed71fc58524107d8795ef7 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Sat, 25 May 2024 15:28:19 -0700
Subject: [PATCH] Make the video_mode and ciolib_mode out params option (may be
 NULL)

---
 src/uifc/uifc_ini.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/uifc/uifc_ini.c b/src/uifc/uifc_ini.c
index a62279f03c..42c09aba7f 100644
--- a/src/uifc/uifc_ini.c
+++ b/src/uifc/uifc_ini.c
@@ -26,12 +26,14 @@ void read_uifc_ini(const char* path, uifcapi_t* uifc, int* ciolib_mode, enum tex
 	FILE* fp = iniOpenFile(path, /* update: */false);
 
 	const char* section = ROOT_SECTION;
-	*video_mode = iniReadInteger(fp, section, "video_mode", *video_mode);
+	if (video_mode != NULL)
+		*video_mode = iniReadInteger(fp, section, "video_mode", *video_mode);
 	uifc->mode = iniReadInteger(fp, section, "uifc_mode", uifc->mode);
 	uifc->scrn_len = iniReadInteger(fp, section, "lines", uifc->scrn_len);
 	uifc->insert_mode = iniReadBool(fp, section, "insert", uifc->insert_mode);
 	uifc->esc_delay = iniReadInteger(fp, section, "esc_delay", uifc->esc_delay);
-	*ciolib_mode = iniReadInteger(fp, section, "ciolib_mode", *ciolib_mode);
+	if (ciolib_mode != NULL)
+		*ciolib_mode = iniReadInteger(fp, section, "ciolib_mode", *ciolib_mode);
 	ciolib_initial_scaling = iniReadFloat(fp, section, "scaling", ciolib_initial_scaling);
 
 	if (fp != NULL)
-- 
GitLab