From 17b19e544d3d42bc5ec55c78715840801c421710 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on ChromeOS)" <rob@synchro.net>
Date: Sat, 11 Feb 2023 16:44:23 -0800
Subject: [PATCH] Fix bug where file.ini min_dspace could be set to -1

min_dspace is an *unsigned* short, so saving 65535 (the default) was converting
the signed decimal representation when saving file.ini.
---
 src/sbbs3/scfgsave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sbbs3/scfgsave.c b/src/sbbs3/scfgsave.c
index 2fb3fccac4..fccfd0abe9 100644
--- a/src/sbbs3/scfgsave.c
+++ b/src/sbbs3/scfgsave.c
@@ -614,7 +614,7 @@ BOOL write_file_cfg(scfg_t* cfg, int backup_level)
 	backup(inipath, backup_level, TRUE);
 
 	str_list_t ini = strListInit();
-	iniSetShortInt(&ini, ROOT_SECTION, "min_dspace", cfg->min_dspace, NULL);
+	iniSetUShortInt(&ini, ROOT_SECTION, "min_dspace", cfg->min_dspace, NULL);
 	iniSetShortInt(&ini, ROOT_SECTION, "max_batup", cfg->max_batup, NULL);
 	iniSetShortInt(&ini, ROOT_SECTION, "max_batdn", cfg->max_batdn, NULL);
 	iniSetShortInt(&ini, ROOT_SECTION, "max_userxfer" ,cfg->max_userxfer, NULL);
-- 
GitLab