+/* Determine whether an ERROR message is safe to show (no IP address in it) */
+static int
+is_safe_error(const char *message)
+{
+ char prefix2[100];
+ const char *p;
+
+ if (!strncmp(message, "Closing Link: 127.0.0.1 (", 25))
+ return 1;
+ snprintf(prefix2, sizeof prefix2,
+ "Closing Link: 127.0.0.1 %s (", me.name);
+ if (!strncmp(message, prefix2, strlen(prefix2)))
+ return 1;
+ if (!strncmp(message, "Restart by ", 11))
+ return 1;
+ if (!strncmp(message, "Terminated by ", 14))
+ return 1;
+
+ if (!ircncmp(message, "Closing Link", 12))
+ return 0;
+ if (strchr(message, '['))
+ return 0;
+ p = strchr(message, '.');
+ if (p != NULL && p[1] != '\0')
+ return 0;
+ if (strchr(message, ':'))
+ return 0;
+
+ return 1;
+}