mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
input: Fix check for mouse coordinates
Must check for EOF which will result in row/col being uninitialized.
This commit is contained in:
parent
7b537ffda9
commit
361c2290b6
@ -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
|
// find mouse coordinates, and it would be too expensive to refactor this
|
||||||
// now.
|
// now.
|
||||||
int col, row, advance;
|
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) {
|
if (col >= 0 && row >= 0) {
|
||||||
mouse_row = row;
|
mouse_row = row;
|
||||||
mouse_col = col;
|
mouse_col = col;
|
||||||
|
Loading…
Reference in New Issue
Block a user