aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FICS/lists.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/FICS/lists.c b/FICS/lists.c
index 7b3039a..5a19d30 100644
--- a/FICS/lists.c
+++ b/FICS/lists.c
@@ -215,26 +215,28 @@ PRIVATE List *list_findpartial(int p, char *which, int gonnado)
return gl;
}
-/* see if something is in a list */
-PUBLIC int in_list(int p, enum ListWhich which, char *member)
+/*
+ * See if something is in a list
+ */
+PUBLIC int
+in_list(int p, enum ListWhich which, char *member)
{
- List *gl;
- int i;
- int filterList = (which == L_FILTER);
-
- gl = list_find(p, which);
- if ((gl == NULL) || (member == NULL))
- return 0;
- for (i = 0; i < gl->numMembers; i++) {
- if (filterList) {
- if (!strncasecmp(member, gl->member[i], strlen(gl->member[i])))
- return 1;
- } else {
- if (!strcasecmp(member, gl->member[i]))
- return 1;
- }
- }
- return 0;
+ List *gl;
+ int filterList = (which == L_FILTER);
+
+ if ((gl = list_find(p, which)) == NULL || member == NULL)
+ return 0;
+ for (int i = 0; i < gl->numMembers; i++) {
+ if (filterList) {
+ if (!strncasecmp(member, gl->member[i],
+ strlen(gl->member[i])))
+ return 1;
+ } else {
+ if (!strcasecmp(member, gl->member[i]))
+ return 1;
+ }
+ }
+ return 0;
}
/*