aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2014-07-18 21:41:28 +0100
committerFranklin Wei <frankhwei536@gmail.com>2014-07-18 21:41:28 +0100
commit4233f6c3fa0928b773a1076eda4e82b3e75af97e (patch)
tree7d49695815ea23e8986b6495b3c4b17fa05389a5
parentd3d405d257a328e8454b851846703bb708e0a975 (diff)
downloadwargames-server-4233f6c3fa0928b773a1076eda4e82b3e75af97e.zip
wargames-server-4233f6c3fa0928b773a1076eda4e82b3e75af97e.tar.gz
wargames-server-4233f6c3fa0928b773a1076eda4e82b3e75af97e.tar.bz2
wargames-server-4233f6c3fa0928b773a1076eda4e82b3e75af97e.tar.xz
Added CR/LF to print_string
-rw-r--r--util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util.c b/util.c
index c27981a..a72a1bb 100644
--- a/util.c
+++ b/util.c
@@ -38,7 +38,10 @@ void print_string(const char* str) /* print string, slowly */
int i=0;
while(str[i])
{
- write(out_fd, &str[i], 1);
+ if(str[i]=='\n')
+ write(out_fd, "\r\n", 2);
+ else
+ write(out_fd, &str[i], 1);
fsync(out_fd);
usleep(SLEEP_TIME);
++i;