wm: ticl

Download patch

ref: 375f68cba6f87f824a01f604b65057138c754a43
parent: 4a3b80329a99d6d11a070d42c0103810bfdb7625
author: libredev <libredev@ircforever.org>
date: Sat Jan 21 11:12:10 EST 2023

don't terminate on command ERROR and 432

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