diff options
| author | cashmere <cashmere@autistici.org> | 2026-06-30 23:29:11 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-06-30 23:29:11 +0200 |
| commit | f1144f53737faefeb20bf24c60b3c25778ce3069 (patch) | |
| tree | 55363f58b376f3298da9c1ad4731d01087d2c603 /src | |
| parent | 1e6a829cbcb3a308bf78be8714e6c2a10fcf3248 (diff) | |
| download | telnet-f1144f53737faefeb20bf24c60b3c25778ce3069.tar.gz | |
src/main.c: prompt user to enter nickname
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1,6 +1,7 @@ #include <netinet/in.h> #include <poll.h> #include <stdio.h> +#include <string.h> #include <sys/socket.h> #include <unistd.h> @@ -41,6 +42,8 @@ int handle_new_connection(int sfd, struct pollfd *fds, nfds_t *nfds, fds[*nfds].fd = conn; fds[*nfds].events = POLLIN; clients[*nfds].has_nickname = 0; + char *message = "Enter your nickname:\n"; + write(fds[*nfds].fd, message, strlen(message)); (*nfds)++; return 0; } |
