diff options
author | James Booth <boothj5@gmail.com> | 2014-04-02 22:19:27 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-04-02 22:19:27 +0100 |
commit | e083e203136a71948a258c2c46cc5d5849ef944d (patch) | |
tree | 96c3e500a8c4ba8aa45129f0a5f8ea43b7de7a51 | |
parent | a720ef262774e51066f5885c76deebde83dec74e (diff) | |
download | profani-tty-e083e203136a71948a258c2c46cc5d5849ef944d.tar.gz |
Added check on input length
-rw-r--r-- | src/ui/inputwin.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 5b5fb381..365eed02 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -142,6 +142,10 @@ _inp_get_char(char *input, int *size) // if it wasn't an arrow key etc if (!_handle_edit(result, ch, input, size)) { if (_printable(ch) && result != KEY_CODE_YES) { + if (*size >= INP_WIN_MAX) { + return ERR; + } + inp_x = getcurx(inp_win); // handle insert if not at end of input |