From 9369bad57c001e3ddd2e78f4a2ed12e06355e753 Mon Sep 17 00:00:00 2001 From: ninya9k <> Date: Wed, 15 Nov 2023 12:35:13 +0000 Subject: [PATCH] oOOooooOo game<->game mystery crash oOOooOOooooOoo --- uttt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uttt.c b/uttt.c index 35f1a36..d4d7e22 100644 --- a/uttt.c +++ b/uttt.c @@ -510,7 +510,7 @@ int ut_network_game(struct ut_state *state, int sock, char player, bool readable int r = 4, c = 4; ut_curserase(); ut_cursdraw(state); - ut_sockdraw(state, sock); + if (readable) ut_sockdraw(state, sock); char w = ut_winner((char *)state->boards, 0, 3); if(w) { @@ -597,7 +597,7 @@ int ut_host_game(struct ut_state *state) { // check to determine readable char byte; - ut_dprintf(conn, "| Press enter to start: "); + ut_dprintf(conn, "| Press enter to start.\n"); if (ut_readfill(conn, &byte, 1)) { printf("Connection closed.\n"); return 1; @@ -642,7 +642,7 @@ int ut_join_game(struct ut_state *state) { } // tell host to deactivate readable - ut_dprintf(sock, "\0\n"); + ut_writefill(sock, "\0\n", 2); // host decides X or O char player_buf[2];