aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-10 18:51:47 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-10 18:51:47 -0400
commitfde26a7c16c4662ede268bfd5cb1f61d6189dde2 (patch)
tree12b33770efdb598e8375bc58ce53bcad25e49cc4
parentbf64776864715f5fd707883625b40e61343e3df2 (diff)
downloadrunes-fde26a7c16c4662ede268bfd5cb1f61d6189dde2.tar.gz
runes-fde26a7c16c4662ede268bfd5cb1f61d6189dde2.zip
this is only necessary if we're actually drawing things
-rw-r--r--display.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/display.c b/display.c
index c9fbad9..da15311 100644
--- a/display.c
+++ b/display.c
@@ -37,11 +37,11 @@ void runes_display_get_term_size(RunesTerm *t, int *row, int *col, int *xpixel,
void runes_display_glyph(RunesTerm *t, char *buf, size_t len)
{
- cairo_font_extents_t extents;
+ if (len) {
+ cairo_font_extents_t extents;
- cairo_font_extents(t->cr, &extents);
+ cairo_font_extents(t->cr, &extents);
- if (len) {
char *nl;
buf[len] = '\0';
while ((nl = strchr(buf, '\n'))) {