diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-09-17 16:39:24 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-09-17 16:39:24 +0200 |
commit | b4d21096ed4cc38b6131bdd30fece5b88c77a654 (patch) | |
tree | d34443db8dfb890f0868891d6c92046cd725bf2c /src/main.c | |
parent | aad0ceb1544a9c3daf9c70db7575503529a7a928 (diff) | |
download | bbs-b4d21096ed4cc38b6131bdd30fece5b88c77a654.tar.gz |
test fix
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |