aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
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);