diff options
author | Thomas White <taw@bitwiz.me.uk> | 2018-10-30 17:56:38 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2018-10-30 17:56:38 +0100 |
commit | 19f20ab06476f93977d1c7130b76f7c31d198936 (patch) | |
tree | 5410b960ab5b00d043a0d828299116baf38d0eeb /src/frame.c | |
parent | 6171bc9d7f86ea0ac1c6abd4a213850fa4f81300 (diff) |
Fix errors reported by static analyser
Diffstat (limited to 'src/frame.c')
-rw-r--r-- | src/frame.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c index 2926d4e..cf6bd7f 100644 --- a/src/frame.c +++ b/src/frame.c @@ -698,7 +698,7 @@ void ensure_run(struct frame *fr, struct edit_pos cpos) int find_cursor(struct frame *fr, double x, double y, struct edit_pos *pos) { - double pad = fr->pad_t; + double pad; int i; if ( fr == NULL ) { @@ -706,6 +706,8 @@ int find_cursor(struct frame *fr, double x, double y, struct edit_pos *pos) return 1; } + pad = fr->pad_t; + for ( i=0; i<fr->n_paras; i++ ) { double npos = pad + paragraph_height(fr->paras[i]); if ( npos > y ) { |