projects
/
visor
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't crash with no buffers, and clear the screen on exit
[visor]
/
libvisor
/
src
/
visor.c
diff --git
a/libvisor/src/visor.c
b/libvisor/src/visor.c
index
2c93521
..
84ffd95
100644
(file)
--- a/
libvisor/src/visor.c
+++ b/
libvisor/src/visor.c
@@
-100,13
+100,15
@@
void vi_term_size(struct visor *vi, int xsz, int ysz)
void vi_redraw(struct visor *vi)
{
void vi_redraw(struct visor *vi)
{
- int i, col, cur_x = 0, cur_y = 0;
+ int i = 0, col, cur_x = 0, cur_y = 0;
char c;
struct vi_buffer *vb;
struct vi_span *sp, *spans_end;
const char *tptr, *tend;
vi_addr spoffs, addr;
char c;
struct vi_buffer *vb;
struct vi_span *sp, *spans_end;
const char *tptr, *tend;
vi_addr spoffs, addr;
+ if(!vi->buflist) goto end;
+
vb = vi->buflist;
if(!(sp = vi_buf_find_span(vb, vb->view_start, &spoffs))) {
sp = vb->spans;
vb = vi->buflist;
if(!(sp = vi_buf_find_span(vb, vb->view_start, &spoffs))) {
sp = vb->spans;