aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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