summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorcashmere <cashmere@autistici.org>2026-06-30 23:28:01 +0200
committercashmere <cashmere@autistici.org>2026-06-30 23:28:01 +0200
commit1e6a829cbcb3a308bf78be8714e6c2a10fcf3248 (patch)
tree2c3a65fb5d0b345a57c1e83fdbc3ddb2b57a9a41 /src/main.c
parenteb050ea4a53d750125eedb27ec3e84356cb1b88d (diff)
downloadtelnet-1e6a829cbcb3a308bf78be8714e6c2a10fcf3248.tar.gz
src/main.c: include struct client into `process_message`
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 761ef9b..97d9f18 100644
--- a/src/main.c
+++ b/src/main.c
@@ -48,7 +48,7 @@ int handle_new_connection(int sfd, struct pollfd *fds, nfds_t *nfds,
// process message to all the connected clients.
// returns 0 on success and -1 on failure.
// TODO: add struct client *clients
-int process_message(struct pollfd *fds, nfds_t *nfds) {
+int process_message(struct pollfd *fds, nfds_t *nfds, struct client *clients) {
for (nfds_t i = 1; i < *nfds; i++) {
/* if client has something to say */
if (fds[i].revents & POLLIN) {
@@ -112,7 +112,7 @@ int main() {
continue;
}
}
- if (process_message(fds, &nfds) == -1) {
+ if (process_message(fds, &nfds, clients) == -1) {
perror("could not process message");
continue;
}