diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-01-15 08:58:14 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-01-15 09:00:38 -0300 |
commit | 361c2290b6d8280c61d3e8193fa08f638f790da1 (patch) | |
tree | abba3ac57d97ede7a571e81d262bd67a703507fe /src | |
parent | 7b537ffda9751c1ec48fafae0f5b2a6bee29ad8b (diff) | |
download | rneovim-361c2290b6d8280c61d3e8193fa08f638f790da1.tar.gz rneovim-361c2290b6d8280c61d3e8193fa08f638f790da1.tar.bz2 rneovim-361c2290b6d8280c61d3e8193fa08f638f790da1.zip |
input: Fix check for mouse coordinates
Must check for EOF which will result in row/col being uninitialized.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/os/input.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index f04f0d8092..2ae4558f3d 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -233,7 +233,7 @@ static unsigned int handle_mouse_event(char **ptr, uint8_t *buf, // find mouse coordinates, and it would be too expensive to refactor this // now. int col, row, advance; - if (sscanf(*ptr, "<%d,%d>%n", &col, &row, &advance)) { + if (sscanf(*ptr, "<%d,%d>%n", &col, &row, &advance) != EOF && advance) { if (col >= 0 && row >= 0) { mouse_row = row; mouse_col = col; |