From 361c2290b6d8280c61d3e8193fa08f638f790da1 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 15 Jan 2015 08:58:14 -0300 Subject: [PATCH] input: Fix check for mouse coordinates Must check for EOF which will result in row/col being uninitialized. --- src/nvim/os/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;