mirror of
https://github.com/Tiiffi/mcrcon.git
synced 2025-10-27 11:21:07 -04:00
Merge pull request #39 from kabiroberai/master
Flush stdout when needed
This commit is contained in:
3
mcrcon.c
3
mcrcon.c
@ -557,6 +557,8 @@ void packet_print(rc_packet *packet)
|
|||||||
|
|
||||||
// print newline if string has no newline
|
// print newline if string has no newline
|
||||||
if (packet->data[i-1] != 10 && packet->data[i-1] != 13) putchar('\n');
|
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)
|
rc_packet *packet_build(int id, int cmd, char *s1)
|
||||||
@ -654,6 +656,7 @@ int run_terminal_mode(int sock)
|
|||||||
|
|
||||||
while (global_connection_alive) {
|
while (global_connection_alive) {
|
||||||
putchar('>');
|
putchar('>');
|
||||||
|
fflush(stdout);
|
||||||
int len = get_line(command, DATA_BUFFSIZE);
|
int len = get_line(command, DATA_BUFFSIZE);
|
||||||
|
|
||||||
if ((strcasecmp(command, "exit") && strcasecmp(command, "quit")) == 0)
|
if ((strcasecmp(command, "exit") && strcasecmp(command, "quit")) == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user