aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-31 17:40:14 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-31 17:40:14 +0100
commit9cb2381e751f907039077c2e8a26b81444c90ebe (patch)
treeffdd2b019d560fa407884b736e9a6ff1439de3c6
parent740ccc108a3772bf7db5b87fac569f82e42c8324 (diff)
Reformatted player_find_bylogin()
-rw-r--r--FICS/playerdb.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index be6e18e..5dcde80 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -990,21 +990,23 @@ PUBLIC int player_find(int fd)
return -1;
}
-PUBLIC int player_find_bylogin(char *name)
+PUBLIC int
+player_find_bylogin(char *name)
{
- int i;
+ for (int i = 0; i < p_num; i++) {
+ if (parray[i].status == PLAYER_EMPTY ||
+ parray[i].status == PLAYER_LOGIN ||
+ parray[i].status == PLAYER_PASSWORD)
+ continue;
- for (i = 0; i < p_num; i++) {
- if ((parray[i].status == PLAYER_EMPTY) ||
- (parray[i].status == PLAYER_LOGIN) ||
- (parray[i].status == PLAYER_PASSWORD))
- continue;
- if (!parray[i].login)
- continue;
- if (!strcmp(parray[i].login, name))
- return i;
- }
- return -1;
+ if (!parray[i].login)
+ continue;
+
+ if (!strcmp(parray[i].login, name))
+ return i;
+ }
+
+ return -1;
}
PUBLIC int