wm: ticl

Download patch

ref: 4a3b80329a99d6d11a070d42c0103810bfdb7625
parent: 1cc0a558a2542699440e607273b3337556f8a5a7
author: libredev <libredev@ircforever.org>
date: Sat Jan 21 10:58:54 EST 2023

handle command 432

--- a/main.c
+++ b/main.c
@@ -473,7 +473,7 @@
 	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 @@
 	    || (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 @@
 		writeall(events[networks[i].id].fd, msg);
 		return 0;
 	}
-printbuffer:
 	printf("%d: %s\n", fd, backup);
 	return 0;
 }