]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commitdiff
If we can't load the specified font, give an error message rather
authorSimon Tatham <anakin@pobox.com>
Tue, 15 Oct 2002 17:41:22 +0000 (17:41 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 15 Oct 2002 17:41:22 +0000 (17:41 +0000)
than segfaulting.

git-svn-id: http://svn.tartarus.org/sgt/putty@2074 cda61777-01e9-0310-a592-d414129be87e

unix/pterm.c

index 6406c9258baa738c917544c2e144b010187e73b4..b59c27c8f9f3943fcf4c265fceff6c03d5d04735 100644 (file)
@@ -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;