aboutsummaryrefslogtreecommitdiff
path: root/src/wrap.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-08-27 22:29:46 +0200
committerThomas White <taw@bitwiz.org.uk>2013-08-27 22:29:46 +0200
commit3f9b053d662ec26564765b7984443a52b609163b (patch)
tree484227e69a103ed170a777b6de79a892c497f407 /src/wrap.c
parentc1041289e6684efc6c0b44b31adc771eda895b8d (diff)
Don't screw up if there are no lines
Diffstat (limited to 'src/wrap.c')
-rw-r--r--src/wrap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wrap.c b/src/wrap.c
index f094672..01b9484 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -231,6 +231,8 @@ size_t find_cursor_pos(struct frame *fr, double xposd, double yposd)
int idx, trail;
int x_pos_i;
+ if ( fr->n_lines == 0 ) return 0;
+
l = find_cursor_line(fr, yposd, &end);
if ( end ) {