From f7ae05d029d7faa14707966d6ad6e03d73a332f6 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 2 Dec 2024 23:09:40 +0100 Subject: Added player_num_ok_chk() --- FICS/playerdb.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'FICS/playerdb.c') diff --git a/FICS/playerdb.c b/FICS/playerdb.c index d2c27ec..0bcbcaa 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -63,6 +63,13 @@ PUBLIC player parray[PARRAY_SIZE]; PUBLIC int p_num = 0; +PUBLIC bool +player_num_ok_chk(const int num) +{ + return (num >= 0 && num <= p_num && + num < (int)ARRAY_SIZE(parray)); +} + PRIVATE int get_empty_slot(void) { -- cgit v1.2.3