aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/lists.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-11-18 21:37:33 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2025-11-18 21:37:33 +0100
commita80e33d2dae5ed84da5739d99dc30a0b51e5d085 (patch)
tree56998750b12f87b6f3dfb05887c42d4bfc602415 /FICS/lists.c
parent7cca2fca71ef729316028fb59775a4151cfa5f55 (diff)
Fixed warnings found by Coverity
Diffstat (limited to 'FICS/lists.c')
-rw-r--r--FICS/lists.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/FICS/lists.c b/FICS/lists.c
index e93dd5b..f82a7c9 100644
--- a/FICS/lists.c
+++ b/FICS/lists.c
@@ -306,8 +306,14 @@ list_addsub(int p, char *list, char *who, int addsub)
return COM_OK;
member = who; // allow sub removed/renamed player
loadme = 0;
- } else
- member = parray[p1].name;
+ } else {
+ if (p1 < 0) {
+ warnx("%s: unexpected negative number",
+ __func__);
+ return COM_OK;
+ } else
+ member = parray[p1].name;
+ }
} else {
member = who;
}