diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-04-21 01:56:14 +0200 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-04-21 01:56:14 +0200 |
commit | 50d73b6938c62a3f5df91dda0fa3a91baee52127 (patch) | |
tree | c4913650fe772f932b685fbea287a9df55c7ad37 /functions.c | |
parent | 1685960bd0b5686891f94f5e69990512626ffb61 (diff) |
Fix appendcrlf() to strip both CR and LF, fixes mysterious newlines in PRIVMSGs
Diffstat (limited to 'functions.c')
-rw-r--r-- | functions.c | 2 |
1 files changed, 1 insertions, 1 deletions
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'; } |