diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-05-19 11:43:54 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-05-19 11:43:54 +0200 |
commit | 81e11aecf8ea5ba4cf04309e86eca365602553c4 (patch) | |
tree | cc386de5e9658c73f73eb4dec303036df8c4fbff /FICS | |
parent | 471c30e37af53b41429428a16b65b6119039e24f (diff) |
Reformatted functions
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/adminproc.c | 59 |
1 files changed, 36 insertions, 23 deletions
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; } /* |