about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-01-15 01:27:24 +0000
committerJames Booth <boothj5@gmail.com>2015-01-15 01:27:24 +0000
commit40f91de7a3090f40657fb4be9ba8ca1c41257480 (patch)
tree5eea0ab282c5d0f6b3f06d314611d1b24217a459 /src/ui
parentaec14848065765c0101f0ee09fbcf81c920a22d7 (diff)
downloadprofani-tty-40f91de7a3090f40657fb4be9ba8ca1c41257480.tar.gz
Moved string termination out of main loop
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/core.c4
1 files changed, 4 insertions, 0 deletions
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');
 }