From d71f5d9bbdf2cc359ecfd23a8f559c0f3e212d05 Mon Sep 17 00:00:00 2001
From: Markus Uhlin <markus@nifty-networks.net>
Date: Wed, 17 Jul 2024 19:31:15 +0200
Subject: accept_match: added check

---
 FICS/matchproc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'FICS')

diff --git a/FICS/matchproc.c b/FICS/matchproc.c
index 58948a3..adbe5df 100644
--- a/FICS/matchproc.c
+++ b/FICS/matchproc.c
@@ -35,6 +35,7 @@
 
 #include <sys/resource.h>
 
+#include <err.h>
 #include <string.h>
 
 #include "board.h"
@@ -500,6 +501,17 @@ accept_match(int p, int p1)
 	} else {	// resume adjourned game
 		game_delete(p, p1);
 
+		// XXX: must be either
+		if (garray[g].rated != TYPE_UNRATED &&
+		    garray[g].rated != TYPE_RATED) {
+			warnx("%s: adjourned game neither rated/unrated",
+			    __func__);
+			warnx("%s: %s vs %s", __func__,
+			    parray[p].name,
+			    parray[p1].name);
+			garray[g].rated = TYPE_UNRATED;
+		}
+
 		snprintf(tmp, sizeof tmp, "{Game %d (%s vs. %s) Continuing "
 		    "%s %s match.}\n",
 		    (g + 1),
-- 
cgit v1.2.3