commit 4a3b80329a99d6d11a070d42c0103810bfdb7625
parent 1cc0a558a2542699440e607273b3337556f8a5a7
Author: libredev <libredev@ircforever.org>
Date: Sat, 21 Jan 2023 15:58:54 +0530
handle command 432
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c
@@ -473,7 +473,7 @@ event_read(int id)
if (strcmp(cmd, "NOTICE") == 0) {
return 0;
} else if (strcmp(cmd, "ERROR") == 0) {
- goto printbuffer;
+ errx(1, "%d: %s\n", fd, backup);
} else if (strcmp(cmd, "PING") == 0) {
snprintf(msg, sizeof(msg), "PONG %s\r\n", buf);
writeall(fd, msg);
@@ -512,6 +512,8 @@ event_read(int id)
|| (strcmp(cmd, "TOPIC") == 0)
|| (strcmp(cmd, "NOTICE") == 0)) {
return 0;
+ } else if (strcmp(cmd, "432") == 0) { /* Erroneous Nickname */
+ errx(1, "%d: %s\n", fd, backup);
} else if (strcmp(cmd, "433") == 0) { /* Nickname already in use */
split(&buf, ' ');
nick = split(&buf, ' ');
@@ -695,7 +697,6 @@ event_read(int id)
writeall(events[networks[i].id].fd, msg);
return 0;
}
-printbuffer:
printf("%d: %s\n", fd, backup);
return 0;
}