diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2025-03-22 12:37:48 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2025-03-22 12:37:48 +0100 |
commit | 01be961df98a32f286084db4fc91900cbc3b45ac (patch) | |
tree | cce9a1c9b9048cbc5a6daad88e3cf0fe40ce733a /FICS | |
parent | f423cf19395a9e7eaf65d1179667e2229557f8af (diff) |
Make Coverity happy
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/playerdb.c | 5 |
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]); |