summaryrefslogtreecommitdiff
path: root/client_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'client_list.c')
-rw-r--r--client_list.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/client_list.c b/client_list.c
index 8c3a73d..ff86878 100644
--- a/client_list.c
+++ b/client_list.c
@@ -20,13 +20,14 @@
*/
#include <stdlib.h>
+#include <unistd.h>
#include "client_list.h"
#include "datatypes.h"
client_t* client_get_last(client_t* first)
{
- if(!first)
+ if(!first)
return NULL;
while(first->next) {
@@ -61,7 +62,7 @@ int client_add(client_t** first, int fd)
*first = new_client;
return 0;
}
-
+
client_get_last(*first)->next = new_client;
return 0;
@@ -69,7 +70,7 @@ int client_add(client_t** first, int fd)
void client_remove(client_t** first, int fd)
{
- if(!first || !(*first))
+ if(!first || !(*first))
return;
client_t* deletee = *first;
@@ -98,7 +99,7 @@ client_t* client_find(client_t* first, int fd)
{
if(!first)
return NULL;
-
+
while(first) {
if(first->fd == fd)
return first;
@@ -110,7 +111,7 @@ client_t* client_find(client_t* first, int fd)
void client_clear(client_t** first)
{
- if(!first || !(*first))
+ if(!first || !(*first))
return;
while(*first) {