From 9dcb3c543a966770512b4019ab36ed08d943d559 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sun, 27 Nov 2011 03:16:47 +0100 Subject: [PATCH] Connection: Use CRLF for output too --- connection.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connection.cc b/connection.cc index b473287..1a79c48 100644 --- a/connection.cc +++ b/connection.cc @@ -14,7 +14,7 @@ void connection::senses(int tick_id, bool dead, int energy, char around[4]) { char buf[1024]; - snprintf(buf, sizeof(buf), "tick %d\n%senergy %d\naround %.8s\n\n", tick_id, dead ? "DEAD\n" : "", energy, around); + snprintf(buf, sizeof(buf), "tick %d\r\n%senergy %d\r\naround %.8s\r\n\r\n", tick_id, dead ? "DEAD\r\n" : "", energy, around); pthread_mutex_lock(&buf_lock); out_buf.append(buf); @@ -25,7 +25,7 @@ void connection::bump(void) { pthread_mutex_lock(&buf_lock); - out_buf.append("BUMP\n"); + out_buf.append("BUMP\r\n"); pthread_mutex_unlock(&buf_lock); }