aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-25 23:31:28 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-25 23:31:28 +0200
commitc9fac28daf953636d570ceb3b0a730af6c0a2355 (patch)
treeec741853dc3f624a9665eff84a73c4950524c7d8 /FICS
parent9ea5c578303493721723650ebb10063c27db91b0 (diff)
Fixed usage of possibly uninitialized variable
Diffstat (limited to 'FICS')
-rw-r--r--FICS/comproc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c
index 4fe252b..a37e60a 100644
--- a/FICS/comproc.c
+++ b/FICS/comproc.c
@@ -1170,6 +1170,10 @@ alpha_cmp(const void *pp1, const void *pp2)
PRIVATE void
sort_players(int players[PARRAY_SIZE], who_cmp_t cmp_func)
{
+ if (p_num <= 0) {
+ warnx("%s: p_num <= 0", __func__);
+ return;
+ }
for (int i = 0; i < p_num; i++)
players[i] = i;
qsort(players, p_num, sizeof(int), cmp_func);