From 62a09a46305f896635a1a270a4e17d12125f2b48 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Fri, 15 Sep 2017 18:20:15 +1000 Subject: [PATCH] Possibly fix double newlines in ssh --- bbs.c | 2 +- doors.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bbs.c b/bbs.c index f54a758..fda72ac 100644 --- a/bbs.c +++ b/bbs.c @@ -265,7 +265,7 @@ void s_putstring(char *c) { char *ptr2; if (!should_convert_utf8()) { if (sshBBS) { - puts(c); + fprintf(stdout, "%s", c); } else { write(gSocket, c, strlen(c)); } diff --git a/doors.c b/doors.c index 0da1b67..c6b4143 100644 --- a/doors.c +++ b/doors.c @@ -42,7 +42,7 @@ void doorchld_handler(int s) int write_door32sys(struct user_record *user) { struct stat s; - char buffer[256]; + char buffer[1024]; FILE *fptr; char *ptr; int i; @@ -53,7 +53,7 @@ int write_door32sys(struct user_record *user) { mkdir(buffer, 0755); } - sprintf(buffer, "%s/node%d/door32.sys", conf.bbs_path, mynode); + snprintf(buffer, 1024, "%s/node%d/door32.sys", conf.bbs_path, mynode); fptr = fopen(buffer, "w"); @@ -78,7 +78,7 @@ int write_door32sys(struct user_record *user) { // create dorinfo1.def - sprintf(buffer, "%s/node%d", conf.bbs_path, mynode); + snprintf(buffer, 1024, "%s/node%d", conf.bbs_path, mynode); if (stat(buffer, &s) != 0) { mkdir(buffer, 0755); @@ -433,4 +433,4 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c } } timeoutpaused = 0; -} \ No newline at end of file +}