From 4f46b519492cf690dc8a4ca5f40a8ba03cc13b32 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 7 Jul 2024 01:51:51 +0200 Subject: Added usage of ARRAY_SIZE() --- FICS/playerdb.c | 2 +- FICS/talkproc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 91eb43d..00c409c 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -2723,7 +2723,7 @@ player_search(int p, char *name) // Exact match with registered player? snprintf(pdir, sizeof pdir, "%s/%c", player_dir, name[0]); - count = search_directory(pdir, name, buffer, 1000); + count = search_directory(pdir, name, buffer, ARRAY_SIZE(buffer)); if (count > 0 && !strcmp(name, *buffer)) goto ReadPlayerFromFile; // Found an unconnected diff --git a/FICS/talkproc.c b/FICS/talkproc.c index 275ac3b..85da66d 100644 --- a/FICS/talkproc.c +++ b/FICS/talkproc.c @@ -887,7 +887,7 @@ com_mailmess(int p, param_list param) snprintf(mdir, sizeof mdir, "%s/player_data/%c/", stats_dir, parray[p].login[0]); - if (search_directory(mdir, filename, buffer, 1000)) { + if (search_directory(mdir, filename, buffer, ARRAY_SIZE(buffer))) { snprintf(subj, sizeof subj, "Your FICS messages from server %s", fics_hostname); -- cgit v1.2.3