From b4d21096ed4cc38b6131bdd30fece5b88c77a654 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Tue, 17 Sep 2019 16:39:24 +0200 Subject: test fix --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index bdc58e2..b7aa583 100644 --- a/src/main.c +++ b/src/main.c @@ -127,8 +127,10 @@ void handle_connection(int _socket, struct sockaddr_in _addr, int argc, char* ar break; char *needle = strstr(buff, "\r"); - if (needle) //Replace CR with space - *needle = ' '; + if (needle){ //Replace CR with space + needle[0] = '\n'; + (needle - buff + 1) < buffsize ? needle[1]='\0':; + } if(try_write(in[1], buff, cnt, 100)) { LOGPRINTF(_LOG_ERROR, "%i: Consecutive write errors while writing to STDIN.", pid); -- cgit v1.2.3