From 3291bf126e1831645531689c23fd4022fb31ae0d Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Wed, 7 Jan 2015 12:39:27 +0000 Subject: [PATCH] Compare write result correctly with 0 Fixes client sending of orders --- source/client/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/client/net.cpp b/source/client/net.cpp index 956c688..1de5847 100644 --- a/source/client/net.cpp +++ b/source/client/net.cpp @@ -233,7 +233,7 @@ std::string WaitForGamestateMessage(int sockfd) int SendOrdersToServer(int sockfd, const std::string &orders) { int n = write(sockfd,orders.c_str(),orders.length()); - if (0 < n) + if (n < 0) fatal_perror("ERROR writing to socket"); return n; }