Ensure lines end in '\n' for IRC

This commit is contained in:
Quinn Evans 2015-10-02 10:19:23 -06:00
parent 922438fe79
commit e1cb5571b7
1 changed files with 7 additions and 0 deletions

View File

@ -160,6 +160,13 @@ void CHANNEL__SEND(char *cobol_buffer, char *state)
#endif
sent = 0;
total = strlen(msg_buf);
if(msg_buf[total - 2] != '\n') {
if(total < BUFFER_SIZE) {
total++;
}
msg_buf[total - 2] = '\n';
msg_buf[total - 1] = '\0';
}
while(sent < total) {
int status = send(sockfd, msg_buf + sent, total - sent, 0);
if(status == -1) {