aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chat_acceptor.h2
-rw-r--r--user_command.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/chat_acceptor.h b/chat_acceptor.h
index 83d0d51..b8eec36 100644
--- a/chat_acceptor.h
+++ b/chat_acceptor.h
@@ -28,7 +28,7 @@ void *receive_chat_messages(void *arg) {
char *message;
message = strtok(in_buf, separators);
if (strcmp(message, "SESMSG") == 0) {
- printf("\n----> %s", strtok(NULL, separators));
+ printf("\n----> %s \n", strtok(NULL, separators));
printf("%s ", prompt);
fflush(stdout);
}
diff --git a/user_command.h b/user_command.h
index 2e73c90..9e0df5a 100644
--- a/user_command.h
+++ b/user_command.h
@@ -61,6 +61,9 @@ void process_user_command() {
strcpy(out_buf, "SESMSG:");
strcat(out_buf, command);
+
+ out_buf[strlen(out_buf)-1] = '\0';
+
send(client_s, out_buf, strlen(out_buf)+1, 0);
}