From 50d73b6938c62a3f5df91dda0fa3a91baee52127 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 21 Apr 2019 01:56:14 +0200 Subject: Fix appendcrlf() to strip both CR and LF, fixes mysterious newlines in PRIVMSGs --- blabouncer.c | 3 ++- functions.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/blabouncer.c b/blabouncer.c index f025912..489dccf 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -7,7 +7,8 @@ // - Get CAP from server and relay to client // - Add blabouncer MOTD (375, 372, 376) // - Need to delete channels from struct when PARTing them -// - Joining while connected doesn't properly join other clients +// - Disconnecting a client is slow for the client (Please wait, waiting for servers to close connections.." +// - "01:53:47 -!- ServerMode/#test [b] by irc.tghost.co.uk" on existing clients when new client connects // // Example WHOIS reply: // BOUNCER-SERVER RECEIVED: :irc.tghost.co.uk 307 blabounce l_bratch :is identified for this nick diff --git a/functions.c b/functions.c index 86a1f03..56b37d6 100644 --- a/functions.c +++ b/functions.c @@ -41,7 +41,7 @@ int getstdin(char *prompt, char *buff, size_t sz) { // Append CR-LF to the end of a string (after cleaning up any existing trailing CR or LF) void appendcrlf(char *string) { // Make sure it doesn't already end with CR or LF - while (string[strlen(string) - 1] == '\r' || string[strlen(string) - 1] == '\r') { + while (string[strlen(string) - 1] == '\r' || string[strlen(string) - 1] == '\n') { string[strlen(string) - 1] = '\0'; } -- cgit v1.2.3