sort of fixed received message formatting

but actually not
This commit is contained in:
Václav Šmejkal 2023-02-24 16:31:20 +01:00
parent 3976c7e49c
commit 258222160e
Signed by: ENGO150
GPG Key ID: F6D6DF86242C5A59
2 changed files with 11 additions and 2 deletions

View File

@ -50,7 +50,6 @@ int main(void)
for (;;) for (;;)
{ {
printf(">>> "); //TODO: Fix formatting
getline(&line, &line_length, stdin); getline(&line, &line_length, stdin);
why2_send_socket(line, listen_socket); why2_send_socket(line, listen_socket);

View File

@ -265,8 +265,18 @@ void why2_clean_threads(void)
void *why2_listen_server(void *socket) void *why2_listen_server(void *socket)
{ {
char *read = NULL;
printf(">>> "); //TODO: Make this smart
fflush(stdout);
for (;;) for (;;)
{ {
printf("%s\n", why2_read_socket(*((int*) socket))); read = why2_read_socket(*((int*) socket)); //TODO: Fix other user message formatting
printf("\033[A\33[2K\r");
printf("%s\n>>> ", read);
fflush(stdout);
why2_deallocate(read);
} }
} }