From 40f91de7a3090f40657fb4be9ba8ca1c41257480 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 15 Jan 2015 01:27:24 +0000 Subject: Moved string termination out of main loop --- src/ui/core.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ui/core.c') 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'); } -- cgit 1.4.1-2-gfad0