aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/playerdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/playerdb.c')
-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]);