diff options
author | James Booth <boothj5@gmail.com> | 2015-01-15 01:27:24 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-01-15 01:27:24 +0000 |
commit | 40f91de7a3090f40657fb4be9ba8ca1c41257480 (patch) | |
tree | 5eea0ab282c5d0f6b3f06d314611d1b24217a459 /src/ui | |
parent | aec14848065765c0101f0ee09fbcf81c920a22d7 (diff) | |
download | profani-tty-40f91de7a3090f40657fb4be9ba8ca1c41257480.tar.gz |
Moved string termination out of main loop
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/core.c | 4 |
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'); } |