]> git.cworth.org Git - acre/commitdiff
Silence pango warning if X or Y-axis label is unset.
authorCarl Worth <cworth@cworth.org>
Thu, 7 Nov 2013 13:32:32 +0000 (05:32 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 7 Nov 2013 13:32:32 +0000 (05:32 -0800)
Pango emits an annoying warning if we pass it a NULL string, (though
it seems to do the right thing regardless). Quiet it down by passing
it an empty string instead.

acre.c

diff --git a/acre.c b/acre.c
index 5e341fd77b8707bd67fbdd07ced58cce149030f4..5177419ae1b8c7b203851a4878e3d6201101840b 100644 (file)
--- a/acre.c
+++ b/acre.c
@@ -347,6 +347,9 @@ _create_layout (acre_t *acre, const char *text)
 {
     PangoLayout *layout;
 
+    if (text == NULL)
+           text = "";
+
     layout = pango_cairo_create_layout (acre->cr);
     pango_layout_set_font_description (layout, acre->font);
     pango_layout_set_text (layout, text, -1);