ticl

tiny irc channel linker
git clone git://git.ircforever.org/ticl
Log | Files | Refs | Submodules | README | LICENSE

commit 375f68cba6f87f824a01f604b65057138c754a43
parent 4a3b80329a99d6d11a070d42c0103810bfdb7625
Author: libredev <libredev@ircforever.org>
Date:   Sat, 21 Jan 2023 16:12:10 +0530

don't terminate on command ERROR and 432

Diffstat:
Mmain.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c @@ -473,7 +473,8 @@ event_read(int id) if (strcmp(cmd, "NOTICE") == 0) { return 0; } else if (strcmp(cmd, "ERROR") == 0) { - errx(1, "%d: %s\n", fd, backup); + event_del(id); + goto printbuffer; } else if (strcmp(cmd, "PING") == 0) { snprintf(msg, sizeof(msg), "PONG %s\r\n", buf); writeall(fd, msg); @@ -513,7 +514,8 @@ event_read(int id) || (strcmp(cmd, "NOTICE") == 0)) { return 0; } else if (strcmp(cmd, "432") == 0) { /* Erroneous Nickname */ - errx(1, "%d: %s\n", fd, backup); + event_del(id); + goto printbuffer; } else if (strcmp(cmd, "433") == 0) { /* Nickname already in use */ split(&buf, ' '); nick = split(&buf, ' '); @@ -697,6 +699,7 @@ event_read(int id) writeall(events[networks[i].id].fd, msg); return 0; } +printbuffer: printf("%d: %s\n", fd, backup); return 0; }