diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-04-29 20:12:09 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-04-29 20:12:09 (GMT) |
commit | 89ceb1e27afed0bac789e33c2f10eade01747d88 (patch) | |
tree | 6c65efae501c1d3021e6beb4a5697138897dc128 /src/gtkext/gtkbufferview.c | |
parent | 4242e4c75ce7391562cadb2ac66b7179eb6bf7f5 (diff) |
Fixed various usages of uninitialised memory.
Diffstat (limited to 'src/gtkext/gtkbufferview.c')
-rw-r--r-- | src/gtkext/gtkbufferview.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gtkext/gtkbufferview.c b/src/gtkext/gtkbufferview.c index f775de5..b56a170 100644 --- a/src/gtkext/gtkbufferview.c +++ b/src/gtkext/gtkbufferview.c @@ -660,11 +660,21 @@ static gboolean gtk_buffer_view_query_tooltip(GtkWidget *widget, gint x, gint y, static void gtk_buffer_view_compute_requested_size(GtkBufferView *view, gint *width, gint *height) { - if (width != NULL && view->buffer_view != NULL) - *width = g_buffer_view_get_width(view->buffer_view, GTK_VIEW_PANEL(view)->display); + if (width != NULL) + { + if (view->buffer_view != NULL) + *width = g_buffer_view_get_width(view->buffer_view, GTK_VIEW_PANEL(view)->display); + else + *width = 0; + } - if (height != NULL && view->buffer_view != NULL) - *height = g_buffer_view_get_height(view->buffer_view); + if (height != NULL) + { + if (view->buffer_view != NULL) + *height = g_buffer_view_get_height(view->buffer_view); + else + *height = 0; + } } |