From: Simon Tatham Date: Tue, 15 Oct 2002 17:41:22 +0000 (+0000) Subject: If we can't load the specified font, give an error message rather X-Git-Tag: r8855-g4f798d~2120 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=3f5a42d3f3ae37a9c214fcf91cd6a9c9d777db7a;p=PuTTY_svn.git If we can't load the specified font, give an error message rather than segfaulting. git-svn-id: http://svn.tartarus.org/sgt/putty@2074 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/unix/pterm.c b/unix/pterm.c index 6406c925..b59c27c8 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -1540,6 +1540,10 @@ int main(int argc, char **argv) } inst->fonts[0] = gdk_font_load(cfg.font); + if (!inst->fonts[0]) { + fprintf(stderr, "pterm: unable to load font \"%s\"\n", cfg.font); + exit(1); + } inst->fonts[1] = NULL; /* FIXME: what about bold font? */ inst->font_width = gdk_char_width(inst->fonts[0], ' '); inst->font_height = inst->fonts[0]->ascent + inst->fonts[0]->descent;