aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-03-22 12:37:48 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2025-03-22 12:37:48 +0100
commit01be961df98a32f286084db4fc91900cbc3b45ac (patch)
treecce9a1c9b9048cbc5a6daad88e3cf0fe40ce733a /FICS
parentf423cf19395a9e7eaf65d1179667e2229557f8af (diff)
Make Coverity happy
Diffstat (limited to 'FICS')
-rw-r--r--FICS/playerdb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index a892e3d..eefdcde 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -2845,8 +2845,11 @@ player_search(int p, char *name)
int p1, count;
// Exact match with connected player?
- if ((p1 = player_find_bylogin(name)) >= 0)
+ if ((p1 = player_find_bylogin(name)) >= 0) {
+ if (p1 + 1 >= (int)ARRAY_SIZE(parray))
+ return 0;
return (p1 + 1);
+ }
// Exact match with registered player?
snprintf(pdir, sizeof pdir, "%s/%c", player_dir, name[0]);