aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-09-17 16:39:24 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-09-17 16:39:24 +0200
commitb4d21096ed4cc38b6131bdd30fece5b88c77a654 (patch)
treed34443db8dfb890f0868891d6c92046cd725bf2c /src
parentaad0ceb1544a9c3daf9c70db7575503529a7a928 (diff)
downloadbbs-b4d21096ed4cc38b6131bdd30fece5b88c77a654.tar.gz
test fix
Diffstat (limited to 'src')
-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);