From 7d5fbd58e7a02444102270cff8fb73fa0d351ba1 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Fri, 15 Dec 2023 20:25:17 +0100 Subject: Reformatted in_list() --- FICS/lists.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'FICS') 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; } /* -- cgit v1.2.3