aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-31 17:42:05 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-31 17:42:05 +0100
commite719c1472211b92171430447b8e80a1525a83585 (patch)
tree179f86fc5c1f4da897722fba12cb261f0598dda9
parent9cb2381e751f907039077c2e8a26b81444c90ebe (diff)
Reformatted player_find()
-rw-r--r--FICS/playerdb.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index 5dcde80..d4bb0a3 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -977,17 +977,17 @@ PUBLIC int player_save(int p)
return 0;
}
-PUBLIC int player_find(int fd)
+PUBLIC int
+player_find(int fd)
{
- int i;
+ for (int i = 0; i < p_num; i++) {
+ if (parray[i].status == PLAYER_EMPTY)
+ continue;
+ if (parray[i].socket == fd)
+ return i;
+ }
- for (i = 0; i < p_num; i++) {
- if (parray[i].status == PLAYER_EMPTY)
- continue;
- if (parray[i].socket == fd)
- return i;
- }
- return -1;
+ return -1;
}
PUBLIC int