Compare write result correctly with 0
Fixes client sending of orders
This commit is contained in:
parent
1c97177956
commit
3291bf126e
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue