about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/profanity.c1
-rw-r--r--src/ui/core.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/profanity.c b/src/profanity.c
index 2a0901b3..30a55b0c 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -116,7 +116,6 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
             ui_update();
         }
 
-        inp[size++] = '\0';
         cmd_result = process_input(inp);
     }
 }
diff --git a/src/ui/core.c b/src/ui/core.c
index 9668a7a3..50fa8539 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -193,6 +193,10 @@ ui_get_char(char *input, int *size)
         ui_input_nonblocking(FALSE);
     }
 
+    if (ch == '\n') {
+        input[*size++] = '\0';
+    }
+
     return (ch != '\n');
 }