From 81e11aecf8ea5ba4cf04309e86eca365602553c4 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 19 May 2024 11:43:54 +0200 Subject: Reformatted functions --- FICS/adminproc.c | 59 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 23 deletions(-) (limited to 'FICS') diff --git a/FICS/adminproc.c b/FICS/adminproc.c index 08a3d1e..9754c6d 100644 --- a/FICS/adminproc.c +++ b/FICS/adminproc.c @@ -439,35 +439,48 @@ strcmpwild(char *mainstr, char *searchstr) * This command returns the names of all users currently logged on * from a given IP address. */ -PUBLIC int com_checkIP(int p, param_list param) +PUBLIC int +com_checkIP(int p, param_list param) { - char *ipstr = param[0].val.word; - int p1; + char *ipstr = param[0].val.word; + int p1; - ASSERT(parray[p].adminLevel >= ADMIN_ADMIN); - pprintf(p, "Matches the following player(s): \n\n"); - for (p1 = 0; p1 < p_num; p1++) - if (!strcmpwild(dotQuad(parray[p1].thisHost), ipstr) && (parray[p1].status != PLAYER_EMPTY)) - pprintf(p, "%16.16s %s\n", parray[p1].name, dotQuad(parray[p1].thisHost)); - return COM_OK; + ASSERT(parray[p].adminLevel >= ADMIN_ADMIN); + + pprintf(p, "Matches the following player(s): \n\n"); + + for (p1 = 0; p1 < p_num; p1++) { + if (!strcmpwild(dotQuad(parray[p1].thisHost), ipstr) && + (parray[p1].status != PLAYER_EMPTY)) { + pprintf(p, "%16.16s %s\n", parray[p1].name, + dotQuad(parray[p1].thisHost)); + } + } + + return COM_OK; } -PUBLIC int com_checkSOCKET(int p, param_list param) +PUBLIC int +com_checkSOCKET(int p, param_list param) { - int fd = param[0].val.integer; - int p1, flag; + int fd = param[0].val.integer; + int p1, flag; - ASSERT(parray[p].adminLevel >= ADMIN_ADMIN); - flag = 0; - for (p1 = 0; p1 < p_num; p1++) { - if (parray[p1].socket == fd) { - flag = 1; - pprintf(p, "Socket %d is used by %s\n", fd, parray[p1].name); - } - } - if (!flag) - pprintf(p, "Socket %d is unused!\n", fd); - return COM_OK; + ASSERT(parray[p].adminLevel >= ADMIN_ADMIN); + + flag = 0; + + for (p1 = 0; p1 < p_num; p1++) { + if (parray[p1].socket == fd) { + flag = 1; + pprintf(p, "Socket %d is used by %s\n", fd, + parray[p1].name); + } + } + + if (!flag) + pprintf(p, "Socket %d is unused!\n", fd); + return COM_OK; } /* -- cgit v1.2.3