summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 103ca2d..e90bbb7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,7 +52,7 @@ int process_message(struct pollfd *fds, nfds_t *nfds) {
read(fds[i].fd, buffer,
sizeof(buffer)); /* read the message which the client sent */
/* if message of the client returns an error */
- if (message <= 0) {
+ if (message < 0) {
/* close the connection if client disappeared or disconnected */
close(fds[i].fd);
fds[i] = fds[*nfds - 1]; /* move back last slot */