Skip to content

Commit

Permalink
Merge pull request #39 from kabiroberai/master
Browse files Browse the repository at this point in the history
Flush stdout when needed
  • Loading branch information
Tiiffi authored Feb 8, 2021
2 parents 3e8acd5 + 58a7a86 commit bf11460
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mcrcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ void packet_print(rc_packet *packet)

// print newline if string has no newline
if (packet->data[i-1] != 10 && packet->data[i-1] != 13) putchar('\n');

fflush(stdout);
}

rc_packet *packet_build(int id, int cmd, char *s1)
Expand Down Expand Up @@ -654,6 +656,7 @@ int run_terminal_mode(int sock)

while (global_connection_alive) {
putchar('>');
fflush(stdout);
int len = get_line(command, DATA_BUFFSIZE);

if ((strcasecmp(command, "exit") && strcasecmp(command, "quit")) == 0)
Expand Down

0 comments on commit bf11460

Please sign in to comment.