From eb8923572cafdacb835956965e96fd122e252019 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Debian Linux)" <rob@synchro.net>
Date: Sat, 21 Oct 2023 19:43:34 -0700
Subject: [PATCH] Don't log an error if there's no dsts.ini or dsts.dab file
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In a fresh install, neither of these files would exist, and that's normal,
so getstats() should just return true in that case (with the stats struct
zeroed-out).

Fixes error during login to a new install reported by Zoltán Gábor on
Facebook.
---
 src/sbbs3/getstats.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/getstats.c b/src/sbbs3/getstats.c
index ef6cf4bd9a..6cdd9fd18e 100644
--- a/src/sbbs3/getstats.c
+++ b/src/sbbs3/getstats.c
@@ -163,8 +163,10 @@ BOOL getstats(scfg_t* cfg, uint node, stats_t* stats)
 		} legacy_stats;
 
 		SAFEPRINTF(path,"%sdsts.dab",node ? cfg->node_path[node-1] : cfg->ctrl_dir);
+		if(!fexistcase(path))
+			return TRUE;
 		if((file=nopen(path,O_RDONLY))==-1) {
-			return(FALSE); 
+			return(FALSE);
 		}
 		int rd = read(file, &legacy_stats, sizeof(legacy_stats));
 		close(file);
-- 
GitLab