mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
input: Fix check for mouse coordinates
Must check for EOF which will result in row/col being uninitialized.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user