diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-04-05 20:10:20 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-04-05 20:10:20 +0200 |
| commit | d41b57ceb609fb08ff166dd95c6c8c8597302102 (patch) | |
| tree | 2943f6ba7e19fc534e32a2b6d2852a5412a7c4e2 | |
| parent | 164527b74aa6cd04bd50c36399bc14ab90073bcf (diff) | |
| download | vis-d41b57ceb609fb08ff166dd95c6c8c8597302102.tar.gz vis-d41b57ceb609fb08ff166dd95c6c8c8597302102.tar.xz | |
Fix clang static analyzer warnings
| -rw-r--r-- | ui-curses.c | 2 | ||||
| -rw-r--r-- | window.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ui-curses.c b/ui-curses.c index e7986eb..0a8cdcf 100644 --- a/ui-curses.c +++ b/ui-curses.c @@ -194,7 +194,7 @@ static void ui_window_reload(UiWin *w, Text *text) { } static void ui_window_draw_sidebar(UiCursesWin *win, const Line *line) { - if (!win->winside) + if (!win->winside || !line) return; int sidebar_width = snprintf(NULL, 0, "%zd", line->lineno + win->height - 2) + 1; if (win->sidebar_width != sidebar_width) { @@ -448,7 +448,8 @@ bool window_resize(Win *win, int width, int height) { } win->width = width; win->height = height; - memset(win->lines, 0, win->lines_size); + if (win->lines) + memset(win->lines, 0, win->lines_size); window_draw(win); return true; } |
