diff options
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/playerdb.c | 18 |
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 |