From 22799f4ac8f6a5940b81510e0fd6e9368675685d Mon Sep 17 00:00:00 2001 From: GrenderG Date: Mon, 10 Apr 2017 03:50:50 +0200 Subject: [PATCH] Fixed seg. fault moving liens downwards. --- tte.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tte.c b/tte.c index 7ac7b86..a024182 100644 --- a/tte.c +++ b/tte.c @@ -891,7 +891,8 @@ void editorFlipRow(int dir) { int first = (dir == 1) ? ec.cursor_y - 1 : ec.cursor_y; editorUpdateSyntax(&ec.row[first]); editorUpdateSyntax(&ec.row[first] + 1); - editorUpdateSyntax(&ec.row[first] + 2); + if (ec.num_rows - ec.cursor_y - 1 > 2) + editorUpdateSyntax(&ec.row[first] + 2); ec.cursor_y -= dir; ec.dirty++;